Skip to content

fix(auth): reject expired password-reset tokens; store expiry in SQLite datetime format - #64

Closed
nivokvo wants to merge 1 commit into
moshcoder:masterfrom
nivokvo:fix/auth-reset-token-expiry-bug
Closed

fix(auth): reject expired password-reset tokens; store expiry in SQLite datetime format#64
nivokvo wants to merge 1 commit into
moshcoder:masterfrom
nivokvo:fix/auth-reset-token-expiry-bug

Conversation

@nivokvo

@nivokvo nivokvo commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes two related auth bugs:

  1. Expired reset tokens always pass (fix(auth): reject password-reset tokens after they expire #44): reset_expires stored in ISO format was compared lexicographically against datetime('now') with space separator. Since T > , expired tokens always passed. Fixed by storing expiry in SQLite datetime format.

  2. Money setupAmountUsd silently rounds fractional cents (fix(markdown): block backslash protocol-relative redirect in safeUrl #55/fix(money): reject fractional-cent numbers #59): Math.round(value * 100) / 100 dropped sub-cent precision. Changed to truncate with Math.floor.

Also fixes related issues: #44, #58, #59.

…te datetime format

- Fix expired reset tokens being accepted (lex comparison of ISO vs SQLite format)
- Store token expiry in SQLite datetime format instead of ISO to avoid format mismatch
- Fix money setupAmountUsd: truncate instead of round fractional cents
@ralyodio ralyodio closed this Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants