Interface IPasswordResetTokenStore
N-4 (Session C): server-side password-reset token store — issues and atomically consumes
single-use reset tokens so that the plaintext token lives only in transient memory
(generator → e-mail channel) and never appears in the database, access logs, or referer
headers.
Mirrors : each issuance writes a single row
containing sha256(pepper || token), an absolute MaxAge TTL, and a
single-use flag. Verify loads the row under LockForUpdate, checks the hash in
constant time, flips the flag, commits — so a second verify with the same token hits an
already-consumed row and fails regardless of correctness.
public interface IPasswordResetTokenStore
Methods
IssueAsync(long, string, TimeSpan, CancellationToken)
Issues a new reset token. Generates a 32-byte CSPRNG secret (base64url-encoded),
Task<PasswordResetIssueResult> IssueAsync(long userId, string callerResetUrl, TimeSpan ttl, CancellationToken ct = default)
VerifyAndConsumeAsync(Guid, string, CancellationToken)
Verifies and atomically consumes a reset token keyed by jti. On
Task<PasswordResetVerifyResult> VerifyAndConsumeAsync(Guid jti, string token, CancellationToken ct = default)