forked from Kieran/snort
fix: Mnemonic login
This commit is contained in:
parent
28dec3aa0e
commit
e6daf6536e
@ -98,7 +98,7 @@ export const EmailRegex =
|
|||||||
/**
|
/**
|
||||||
* Regex to match a mnemonic seed
|
* Regex to match a mnemonic seed
|
||||||
*/
|
*/
|
||||||
export const MnemonicRegex = /^([^\s]+\s){11}[^\s]+$/;
|
export const MnemonicRegex = /(\w+)/g;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract file extensions regex
|
* Extract file extensions regex
|
||||||
|
@ -32,7 +32,7 @@ export default function useLoginHandler() {
|
|||||||
} else if (key.match(EmailRegex)) {
|
} else if (key.match(EmailRegex)) {
|
||||||
const hexKey = await getNip05PubKey(key);
|
const hexKey = await getNip05PubKey(key);
|
||||||
LoginStore.loginWithPubkey(hexKey);
|
LoginStore.loginWithPubkey(hexKey);
|
||||||
} else if (key.match(MnemonicRegex)) {
|
} else if (key.match(MnemonicRegex)?.length === 24) {
|
||||||
if (!hasSubtleCrypto) {
|
if (!hasSubtleCrypto) {
|
||||||
throw new Error(insecureMsg);
|
throw new Error(insecureMsg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user