Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/routes/(public)/recover/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
let email: string;
let userId: string;
let secret: string;
let userEmail: string;
let password: string;
let confirmPassword: string;
onMount(() => {
userId = page.url.searchParams.get('userId');
secret = page.url.searchParams.get('secret');
userEmail = page.url.searchParams.get('email') || '';
});
async function recover() {
Expand Down Expand Up @@ -76,18 +78,30 @@
{#if userId && secret}
<Form onSubmit={setPassword}>
<Layout.Stack>
<!-- hidden email input for password managers -->
<input
type="email"
name="email"
value={userEmail}
style="position: absolute; left: -9999px; opacity: 0; pointer-events: none;"
tabindex="-1"
autocomplete="username"
aria-hidden="true" />
Comment on lines +82 to +89
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using inline styles for hiding elements is not recommended. Consider using CSS classes or data attributes for better maintainability and consistency with the project's styling approach.

Copilot uses AI. Check for mistakes.


<InputPassword
label="New password"
placeholder="Enter password"
id="password"
autofocus={true}
required={true}
autocomplete={true}
bind:value={password} />
<InputPassword
label="Confirm password"
placeholder="Confirm password"
id="confirm-password"
required={true}
autocomplete={true}
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The autocomplete attribute should be a string value, not a boolean. For password fields, use 'new-password' for the new password field to indicate this is a password creation scenario.

Suggested change
autocomplete={true}
bind:value={password} />
<InputPassword
label="Confirm password"
placeholder="Confirm password"
id="confirm-password"
required={true}
autocomplete={true}
autocomplete="new-password"
bind:value={password} />
<InputPassword
label="Confirm password"
placeholder="Confirm password"
id="confirm-password"
required={true}
autocomplete="new-password"

Copilot uses AI. Check for mistakes.

bind:value={confirmPassword} />

<Button fullWidth submit>Update</Button>
Expand Down