Cleaner error message on aborted Passkey operations.
This commit is contained in:
@@ -37,7 +37,7 @@ const handleLogin = async () => {
|
||||
location.reload()
|
||||
}
|
||||
} catch (error) {
|
||||
authStore.showMessage(`Authentication failed: ${error.message}`, 'error')
|
||||
authStore.showMessage(error.message, 'error')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -124,7 +124,7 @@ const addNewCredential = async () => {
|
||||
authStore.showMessage('New passkey added successfully!', 'success', 3000)
|
||||
} catch (error) {
|
||||
console.error('Failed to add new passkey:', error)
|
||||
authStore.showMessage(`Failed to add passkey: ${error.message}`, 'error')
|
||||
authStore.showMessage(error.message, 'error')
|
||||
} finally {
|
||||
authStore.isLoading = false
|
||||
}
|
||||
|
||||
@@ -32,14 +32,9 @@ async function register() {
|
||||
await authStore.setSessionCookie(result.session_token)
|
||||
|
||||
authStore.showMessage('Passkey registered successfully!', 'success', 2000)
|
||||
authStore.currentView = 'profile'
|
||||
authStore.loadUserInfo().then(authStore.selectView)
|
||||
} catch (error) {
|
||||
console.error('Registration error:', error)
|
||||
if (error.name === "NotAllowedError") {
|
||||
authStore.showMessage('Registration cancelled', 'error')
|
||||
} else {
|
||||
authStore.showMessage(`Registration failed: ${error.message}`, 'error')
|
||||
}
|
||||
authStore.showMessage(`Registration failed: ${error.message}`, 'error')
|
||||
} finally {
|
||||
authStore.isLoading = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user