diff --git a/web-wallet/CHANGELOG.md b/web-wallet/CHANGELOG.md index d25cec8cb0..5793585f01 100644 --- a/web-wallet/CHANGELOG.md +++ b/web-wallet/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update Transactions list design [#1922] - Update `Stake` to use `Stepper` [#2436] - Update Mnemonic (Authenticate) Enter key behavior [#2879] +- Enhance Error Handling on Wallet Access Page [#2932] ### Removed @@ -335,6 +336,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#2880]: https://github.com/dusk-network/rusk/issues/2880 [#2888]: https://github.com/dusk-network/rusk/issues/2888 [#2920]: https://github.com/dusk-network/rusk/issues/2920 +[#2932]: https://github.com/dusk-network/rusk/issues/2932 diff --git a/web-wallet/src/routes/(welcome)/login/+page.svelte b/web-wallet/src/routes/(welcome)/login/+page.svelte index edd3f11e5a..23085dd43f 100644 --- a/web-wallet/src/routes/(welcome)/login/+page.svelte +++ b/web-wallet/src/routes/(welcome)/login/+page.svelte @@ -5,7 +5,7 @@ import { validateMnemonic } from "bip39"; import { Button, Textbox } from "$lib/dusk/components"; - import { AppAnchorButton } from "$lib/components"; + import { AppAnchor, AppAnchorButton, Banner } from "$lib/components"; import { IconHeadingCard } from "$lib/containers/Cards"; import { goto } from "$lib/navigation"; import { @@ -57,8 +57,8 @@ /** @type {string} */ let secretText = ""; - /** @type {string} */ - let errorMessage = ""; + /** @type {null|"invalid-password"|"invalid-mnemonic"} */ + let error = null; /** @type {import("svelte/elements").FormEventHandler} */ function handleUnlockWalletSubmit() { @@ -78,7 +78,10 @@ goto("/setup/restore"); return; } - errorMessage = err.message; + error = + err.message === "Wrong password" + ? "invalid-password" + : "invalid-mnemonic"; fldSecret.focus(); fldSecret.select(); }); @@ -110,8 +113,22 @@ type="password" autocomplete="current-password" /> - {#if errorMessage} - {errorMessage} + {#if error === "invalid-mnemonic"} + +

+ Please ensure you have entered your 12-word mnemonic phrase, with + a space separating each word. +

+
+ {/if} + {#if error === "invalid-password"} + +

+ Please ensure the password entered matches the one you have set up + while setting up the wallet. If you have forgotten your password, + you can restore your wallet. +

+
{/if}