Skip to content

Commit

Permalink
Merge pull request #3288 from dusk-network/3287/show-password-as-default
Browse files Browse the repository at this point in the history
web-wallet: Change password setting as enabled by default
  • Loading branch information
HDauven authored Jan 9, 2025
2 parents 892a8a1 + 3ae2329 commit 1b63a8b
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 62 deletions.
2 changes: 2 additions & 0 deletions web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Update Transactions list design [#1922]
- Change password setting as enabled by default [#3287]

### Removed

Expand Down Expand Up @@ -501,6 +502,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#3265]: https://github.com/dusk-network/rusk/issues/3265
[#3267]: https://github.com/dusk-network/rusk/issues/3267
[#3270]: https://github.com/dusk-network/rusk/issues/3270
[#3287]: https://github.com/dusk-network/rusk/issues/3287

<!-- VERSIONS -->

Expand Down
10 changes: 5 additions & 5 deletions web-wallet/src/routes/(welcome)/setup/PasswordSetup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
export let isValid = false;
/** @type {boolean} */
export let isToggled = false;
export let isToggled = true;
/** @type {string} */
let confirmPassword = "";
Expand Down Expand Up @@ -59,13 +59,13 @@
</ToggleableCard>

<Banner
title="Setting a password for your web wallet is optional."
title="Setting a password for your web wallet is recommended."
variant="info"
>
<p>
Doing so allows you the convenience of accessing your wallet using a
password, but it weakens the overall security. Not using a password requires
you to input the full mnemonic to open your wallet.
Without a password, you will need to input your full mnemonic each time to
access your wallet. This could expose your mnemonic to potential threats.
Setting a password is highly recommended for better wallet security.
</p>
</Banner>

Expand Down
2 changes: 1 addition & 1 deletion web-wallet/src/routes/(welcome)/setup/create/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
let isValidPassword = false;
/** @type {boolean} */
let showPasswordSetup = false;
let showPasswordSetup = true;
/** @type {boolean} */
let agreementAccepted = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ exports[`Create > ensures the Password step renders as expected 1`] = `
class="dusk-card__header-controls-wrapper"
>
<div
aria-checked="false"
aria-checked="true"
aria-disabled="false"
class="dusk-switch dusk-switch--on-surface"
role="switch"
Expand All @@ -2041,6 +2041,40 @@ exports[`Create > ensures the Password step renders as expected 1`] = `
</header>
</div>
<div
class="dusk-card__body-container"
>
<p>
Please store your password safely.
</p>
<input
autocomplete="new-password"
class="dusk-textbox dusk-textbox-password password-input"
placeholder="Set Password"
type="password"
/>
<div
class="confirm-password"
>
<input
autocomplete="new-password"
class="dusk-textbox dusk-textbox-password password-input"
placeholder="Confirm Password"
type="password"
/>
<span
class="confirm-password--meta svelte-ww95yl"
>
Password must be at least 8 characters
</span>
</div>
</div>
</div>
Expand All @@ -2063,13 +2097,13 @@ exports[`Create > ensures the Password step renders as expected 1`] = `
<strong
class="banner__title"
>
Setting a password for your web wallet is optional.
Setting a password for your web wallet is recommended.
</strong>
<p>
Doing so allows you the convenience of accessing your wallet using a
password, but it weakens the overall security. Not using a password requires
you to input the full mnemonic to open your wallet.
Without a password, you will need to input your full mnemonic each time to
access your wallet. This could expose your mnemonic to potential threats.
Setting a password is highly recommended for better wallet security.
</p>
</div>
</div>
Expand Down Expand Up @@ -2103,6 +2137,7 @@ exports[`Create > ensures the Password step renders as expected 1`] = `
<button
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--default dusk-icon-button--labeled"
disabled=""
type="button"
>
<span
Expand Down Expand Up @@ -2228,7 +2263,7 @@ exports[`Create > ensures the Password step renders as expected 2`] = `
class="dusk-card__header-controls-wrapper"
>
<div
aria-checked="true"
aria-checked="false"
aria-disabled="false"
class="dusk-switch dusk-switch--on-surface"
role="switch"
Expand All @@ -2249,40 +2284,6 @@ exports[`Create > ensures the Password step renders as expected 2`] = `
</header>
</div>
<div
class="dusk-card__body-container"
>
<p>
Please store your password safely.
</p>
<input
autocomplete="new-password"
class="dusk-textbox dusk-textbox-password password-input"
placeholder="Set Password"
type="password"
/>
<div
class="confirm-password"
>
<input
autocomplete="new-password"
class="dusk-textbox dusk-textbox-password password-input"
placeholder="Confirm Password"
type="password"
/>
<span
class="confirm-password--meta svelte-ww95yl"
>
Password must be at least 8 characters
</span>
</div>
</div>
</div>
Expand All @@ -2305,13 +2306,13 @@ exports[`Create > ensures the Password step renders as expected 2`] = `
<strong
class="banner__title"
>
Setting a password for your web wallet is optional.
Setting a password for your web wallet is recommended.
</strong>
<p>
Doing so allows you the convenience of accessing your wallet using a
password, but it weakens the overall security. Not using a password requires
you to input the full mnemonic to open your wallet.
Without a password, you will need to input your full mnemonic each time to
access your wallet. This could expose your mnemonic to potential threats.
Setting a password is highly recommended for better wallet security.
</p>
</div>
</div>
Expand Down Expand Up @@ -2345,7 +2346,6 @@ exports[`Create > ensures the Password step renders as expected 2`] = `
<button
class="dusk-button dusk-button--type--button dusk-button--variant--tertiary dusk-button--size--default dusk-icon-button--labeled"
disabled=""
type="button"
>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ describe("Create", async () => {

await fireEvent.click(getByRole("button", { name: "Next" }));

// Password disabled
// Password enabled
expect(container.firstChild).toMatchSnapshot();

await fireEvent.click(getByRole("switch"));

// Password enabled
// Password disabled
expect(container.firstChild).toMatchSnapshot();
});

Expand Down Expand Up @@ -405,7 +405,10 @@ describe("Create", async () => {
await fireEvent.click(getByRole("button", { name: "Next" }));

// Set Password step
await fireEvent.click(getByRole("switch"));

await fireEvent.click(getByRole("button", { name: "Next" }));

expect(loginInfoStorage.get()).toBeNull();

// Swap ERC20 to Native Dusk step
Expand Down Expand Up @@ -472,8 +475,6 @@ describe("Create", async () => {
// Set Password step
expect(loginInfoStorage.get()).toBeNull();

await fireEvent.click(getByRole("switch"));

await fireInput(asInput(getByPlaceholderText("Set Password")), pwd);
await fireInput(asInput(getByPlaceholderText("Confirm Password")), pwd);

Expand Down
2 changes: 1 addition & 1 deletion web-wallet/src/routes/(welcome)/setup/restore/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
let isSyncCompleted = false;
/** @type {boolean} */
let showPasswordSetup = false;
let showPasswordSetup = true;
/** @type {boolean} */
let isValidMnemonic = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ describe("Restore", async () => {
await fireEvent.click(nextButton);

// Set Password step
await fireEvent.click(getByRole("switch"));

await fireEvent.click(getByRole("button", { name: "Next" }));
expect(loginInfoStorage.get()).toBeNull();

Expand Down Expand Up @@ -202,8 +204,6 @@ describe("Restore", async () => {
// Set Password step
expect(loginInfoStorage.get()).toBeNull();

await fireEvent.click(getByRole("switch"));

await fireInput(asInput(getByPlaceholderText("Set Password")), pwd);
await fireInput(asInput(getByPlaceholderText("Confirm Password")), pwd);

Expand Down
8 changes: 4 additions & 4 deletions web-wallet/src/routes/components-showcase/Banners.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
</Banner>
<h3>Long Content</h3>
<Banner
title="Setting a password for your web wallet is optional."
title="Setting a password for your web wallet is recommended."
variant="info"
>
<p>
Doing so allows you the convenience of opening your wallet file using a
password, but it weakens the overall security. Not using a password
requires you to input the full mnemonic to open your wallet.
Without a password, you will need to input your full mnemonic each time to
access your wallet. This could expose your mnemonic to potential threats.
Setting a password is highly recommended for better wallet security.
</p>
</Banner>
</section>

0 comments on commit 1b63a8b

Please sign in to comment.