Class PasswordResetTokenProps
N-4 (Session C): server-side material backing a single-use password-reset token.
The token plaintext (32 bytes of CSPRNG, base64url-encoded) is returned exactly once
from IPasswordResetTokenStore.IssueAsync for delivery via the e-mail channel;
what we persist is sha256(pepper || token) (lowercase hex) so a database leak
does not disclose live reset links. is a per-issuance random
identifier carried on the reset URL alongside the plaintext so verify can locate the
row in O(1).
Consumption is single-use: flips to true atomically
under LockForUpdate during verify, and subsequent attempts against the same
are rejected regardless of token correctness. Expired
( < now) or consumed rows are reaped by a periodic
cleanup route (analogous to timer://identity-mfa-otp-cleanup).
[RedbScheme("identity.password_reset_token")]
public class PasswordResetTokenProps
Inheritance
Properties
Attempts
Count of verify attempts (success+fail). Used by diagnostics and the cleanup route to
public int Attempts { get; set; }
CallerResetUrl
The caller-supplied reset URL captured at issue time (the page that will host the
public string CallerResetUrl { get; set; }
Consumed
True once a successful verify has consumed the token. Mutated under LockForUpdate
public bool Consumed { get; set; }
ExpiresAt
Absolute expiry — verify requests after this instant fail regardless of token.
public DateTimeOffset ExpiresAt { get; set; }
Jti
Random per-issuance identifier. Travels on the reset URL as ?jti=....
public string Jti { get; set; }
TokenHash
sha256(pepper || tokenPlaintext), lowercase hex. Never store plaintext.
public string TokenHash { get; set; }
UserId
Owner user id (joined to _users). Returned to the caller by verify.
public long UserId { get; set; }