fix: Mnemonic login

This commit is contained in:
Kieran 2023-04-21 20:47:02 +01:00
parent 28dec3aa0e
commit e6daf6536e
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ export const EmailRegex =
/**
* Regex to match a mnemonic seed
*/
export const MnemonicRegex = /^([^\s]+\s){11}[^\s]+$/;
export const MnemonicRegex = /(\w+)/g;
/**
* Extract file extensions regex

View File

@ -32,7 +32,7 @@ export default function useLoginHandler() {
} else if (key.match(EmailRegex)) {
const hexKey = await getNip05PubKey(key);
LoginStore.loginWithPubkey(hexKey);
} else if (key.match(MnemonicRegex)) {
} else if (key.match(MnemonicRegex)?.length === 24) {
if (!hasSubtleCrypto) {
throw new Error(insecureMsg);
}