-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- normalize username and email fields to lowercase, resolves #1740
- add autoComplete attributes to auth flow for easier sign in/sign up
- Loading branch information
1 parent
92856b6
commit 89a44cc
Showing
12 changed files
with
36 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,7 @@ export const ForgotPasswordPage = () => { | |
<FormItem> | ||
<FormLabel>{t`Email`}</FormLabel> | ||
<FormControl> | ||
<Input placeholder="[email protected]" {...field} /> | ||
<Input placeholder="[email protected]" autoComplete="email" {...field} /> | ||
</FormControl> | ||
<FormMessage /> | ||
</FormItem> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,12 @@ export const LoginPage = () => { | |
<FormItem> | ||
<FormLabel>{t`Email`}</FormLabel> | ||
<FormControl> | ||
<Input placeholder="[email protected]" {...field} /> | ||
<Input | ||
autoComplete="email" | ||
className="lowercase" | ||
placeholder="[email protected]" | ||
{...field} | ||
/> | ||
</FormControl> | ||
<FormDescription>{t`You can also enter your username.`}</FormDescription> | ||
<FormMessage /> | ||
|
@@ -104,7 +109,7 @@ export const LoginPage = () => { | |
<FormItem> | ||
<FormLabel>{t`Password`}</FormLabel> | ||
<FormControl> | ||
<Input type="password" {...field} /> | ||
<Input type="password" autoComplete="password" {...field} /> | ||
</FormControl> | ||
<FormDescription> | ||
<Trans> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,6 +119,7 @@ export const RegisterPage = () => { | |
<FormLabel>{t`Username`}</FormLabel> | ||
<FormControl> | ||
<Input | ||
className="lowercase" | ||
placeholder={t({ | ||
message: "john.doe", | ||
context: | ||
|
@@ -140,6 +141,7 @@ export const RegisterPage = () => { | |
<FormLabel>{t`Email`}</FormLabel> | ||
<FormControl> | ||
<Input | ||
className="lowercase" | ||
placeholder={t({ | ||
message: "[email protected]", | ||
context: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
tools/prisma/migrations/20250112140257_normalize_user_email_fields/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- This migration normalizes the username and email fields for all users, | ||
-- ensuring that they are stored in lowercase. | ||
UPDATE "User" | ||
SET username = LOWER(username), | ||
email = LOWER(email); | ||
|