Forbid the separator in the sub-addr name
This commit is contained in:
parent
f45c77ba64
commit
1c8d6db391
2 changed files with 15 additions and 9 deletions
|
@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- The style has been entirely reworked using Bootstrap instead of Bulma
|
- The style has been entirely reworked using Bootstrap instead of Bulma
|
||||||
|
- It is now impossible to include the separator in the dedicated name
|
||||||
|
|
||||||
|
|
||||||
## [0.3.0] - 2023-08-25
|
## [0.3.0] - 2023-08-25
|
||||||
|
|
|
@ -29,6 +29,10 @@ const generatedAddr = computed(() => {
|
||||||
const raw_account = accounts.value.find((e) => e.id == selectedAccountId.value);
|
const raw_account = accounts.value.find((e) => e.id == selectedAccountId.value);
|
||||||
if (raw_account) {
|
if (raw_account) {
|
||||||
const account = fromRawAccount(raw_account);
|
const account = fromRawAccount(raw_account);
|
||||||
|
if (subAddrName.value.indexOf(account.separator) != -1) {
|
||||||
|
subAddrName.value = subAddrName.value.replaceAll(account.separator, '');
|
||||||
|
}
|
||||||
|
if (subAddrName.value) {
|
||||||
var hasher = hmac.create(sha256, account.key);
|
var hasher = hmac.create(sha256, account.key);
|
||||||
hasher.update(account.localPart);
|
hasher.update(account.localPart);
|
||||||
hasher.update(account.separator);
|
hasher.update(account.separator);
|
||||||
|
@ -40,6 +44,7 @@ const generatedAddr = computed(() => {
|
||||||
return `${account.localPart}${account.separator}${subAddrName.value}${account.separator}${code}@${account.domain}`;
|
return `${account.localPart}${account.separator}${subAddrName.value}${account.separator}${code}@${account.domain}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return '';
|
return '';
|
||||||
});
|
});
|
||||||
const copyAddr = () => {
|
const copyAddr = () => {
|
||||||
|
|
Loading…
Reference in a new issue