fix error on login
This commit is contained in:
@@ -64,13 +64,14 @@ export const ModalLogin = () => {
|
|||||||
const pubkey = getNpub.names[username]
|
const pubkey = getNpub.names[username]
|
||||||
const npub = nip19.npubEncode(pubkey)
|
const npub = nip19.npubEncode(pubkey)
|
||||||
const passphrase = values.password
|
const passphrase = values.password
|
||||||
|
|
||||||
console.log('fetch', npub, passphrase)
|
console.log('fetch', npub, passphrase)
|
||||||
const k: any = await swicCall('fetchKey', npub, passphrase)
|
const k: any = await swicCall('fetchKey', npub, passphrase)
|
||||||
notify(`Fetched ${k.npub}`, 'success')
|
notify(`Fetched ${k.npub}`, 'success')
|
||||||
cleanUpStates()
|
cleanUpStates()
|
||||||
navigate(`/key/${k.npub}`)
|
navigate(`/key/${k.npub}`)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
notify(error.message, 'error')
|
notify(error?.message || 'Something went wrong!', 'error')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@ export const schema = yup.object().shape({
|
|||||||
return USERNAME_WITH_DOMAIN_REGEXP.test(value)
|
return USERNAME_WITH_DOMAIN_REGEXP.test(value)
|
||||||
})
|
})
|
||||||
.required(),
|
.required(),
|
||||||
password: yup.string().required(),
|
password: yup.string().required().min(4),
|
||||||
})
|
})
|
||||||
|
|
||||||
export type FormInputType = yup.InferType<typeof schema>
|
export type FormInputType = yup.InferType<typeof schema>
|
||||||
|
@@ -273,7 +273,7 @@ export class NoauthBackend {
|
|||||||
})
|
})
|
||||||
if (r.status !== 200 && r.status !== 201) {
|
if (r.status !== 200 && r.status !== 201) {
|
||||||
console.log('Fetch error', url, method, r.status)
|
console.log('Fetch error', url, method, r.status)
|
||||||
throw new Error('Failed to fetch' + url)
|
throw new Error('Failed to fetch ' + url)
|
||||||
}
|
}
|
||||||
|
|
||||||
return await r.json()
|
return await r.json()
|
||||||
|
Reference in New Issue
Block a user