-
Couldn't load subscription status.
- Fork 193
feat: add hidden email input to password reset form for password manager #2415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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() { | ||||||||||||||||||||||||||||||||||
|
|
@@ -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" /> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| <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} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
| 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" |
There was a problem hiding this comment.
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.