Checks the rows password-reset-service.ts reads from
password_reset_tokens to make each reset link work once.
f
isPasswordResetTokenRow(obj: unknown): obj is PasswordResetTokenRow
Checks whether obj, a row resetPassword selected, is a
PasswordResetTokenRow.
I
PasswordResetTokenRow
Stored by requestPasswordReset when it emails a reset link, and read back
by resetPassword when the link is used.
-
expires_at: string
Lets
db/startup.tspurge old rows. The token's ownexpis what ends the link. -
token: string
The signed token itself, which the reset link carries.
-
used_at: string | null
Set when the link is used, and reset to null if the reset then fails.
- user_id: string
Usage
import * as mod from "api/model/password-reset.ts";