forked from bluesky-social/atproto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset password updates (bluesky-social#422)
* Log emails to stdout if no smtp mailer is set (useful for debugging) * Fancier reset-password email template * Update reset password flow to use a human-enterable OTP * Tidy * Run the email template through prettier Co-authored-by: Devin Ivy <[email protected]>
- Loading branch information
Showing
9 changed files
with
505 additions
and
81 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
35 changes: 35 additions & 0 deletions
35
packages/pds/src/db/migrations/20221215T220356370Z-password-reset-otp.ts
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,35 @@ | ||
import { Kysely } from 'kysely' | ||
|
||
const userTable = 'user' | ||
|
||
export async function up(db: Kysely<unknown>): Promise<void> { | ||
await db.schema | ||
.alterTable(userTable) | ||
.addColumn('passwordResetToken', 'varchar') | ||
.execute() | ||
await db.schema | ||
.alterTable(userTable) | ||
.addColumn('passwordResetGrantedAt', 'varchar') | ||
.execute() | ||
await db.schema | ||
.createIndex('user_password_reset_token_idx') | ||
.unique() | ||
.on('user') | ||
.column('passwordResetToken') | ||
.execute() | ||
} | ||
|
||
export async function down(db: Kysely<unknown>): Promise<void> { | ||
await db.schema | ||
.dropIndex('user_password_reset_token_idx') | ||
.on('user') | ||
.execute() | ||
await db.schema | ||
.alterTable(userTable) | ||
.dropColumn('passwordResetToken') | ||
.execute() | ||
await db.schema | ||
.alterTable(userTable) | ||
.dropColumn('passwordResetGrantedAt') | ||
.execute() | ||
} |
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
Oops, something went wrong.