-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link userId to password reset token via database Don't allow reset if the user does not have a password set - this is to protect against two users with duplicate email addresses Don't allow a user to set up a password to login if another user with the same email has a password - that would lead to ambiguous login experience - this is just to ease the migration process to allow duplicate email addresses to be added in. Eventually we would ideally block this. Moved google/sfdc sign up above other fields during login/sign up so we can nudge the user to do that instead of a password
- Loading branch information
Showing
10 changed files
with
136 additions
and
95 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,12 @@ export function PasswordResetInit({ csrfToken }: PasswordResetInitProps) { | |
<h2 className="mt-10 text-center text-2xl font-bold leading-9 tracking-tight text-gray-900">Reset Password</h2> | ||
</div> | ||
<div className="mt-10 sm:mx-auto sm:w-full sm:max-w-sm"> | ||
{isSubmitted && <Alert message="Check your email to continue the reset process." type="success" />} | ||
{isSubmitted && ( | ||
<Alert | ||
message="You will receive an email with instructions if an account exists and is eligible for password reset. Contact [email protected] if you need further assistance." | ||
type="success" | ||
/> | ||
)} | ||
{!isSubmitted && ( | ||
<form onSubmit={handleSubmit(onSubmit)} method="POST" noValidate className="space-y-6"> | ||
<input type="hidden" {...register('csrfToken')} /> | ||
|
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
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20241102174238_add_userid_lookup_password_reset/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,11 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `userId` to the `PasswordResetToken` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "PasswordResetToken" ADD COLUMN "userId" UUID NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "PasswordResetToken" ADD CONSTRAINT "PasswordResetToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
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