This repository was archived by the owner on Apr 21, 2026. It is now read-only.
Commit 845a1c8
committed
fix: auth token lifecycle — expiry, consumption, and hash fixes (wd-2qc)
1. Verification tokens: add expires_at column, 24h expiry, delete after
use (single-use), upgrade Hash() from MD5 to SHA-256
2. Remember-me logout: hash cookie value with SHA-256 before DB lookup
(raw value was compared against stored hash — never matched)
3. RememberToken.createToken(): explicit SHA-256 instead of default MD51 parent a1883f6 commit 845a1c8
4 files changed
Lines changed: 64 additions & 14 deletions
File tree
- app
- controllers/web
- migrator/migrations
- models
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
| |||
693 | 694 | | |
694 | 695 | | |
695 | 696 | | |
696 | | - | |
697 | | - | |
| 697 | + | |
| 698 | + | |
698 | 699 | | |
699 | 700 | | |
700 | 701 | | |
701 | 702 | | |
702 | | - | |
| 703 | + | |
| 704 | + | |
703 | 705 | | |
704 | 706 | | |
705 | 707 | | |
| |||
793 | 795 | | |
794 | 796 | | |
795 | 797 | | |
796 | | - | |
| 798 | + | |
797 | 799 | | |
798 | 800 | | |
799 | 801 | | |
800 | 802 | | |
| 803 | + | |
801 | 804 | | |
802 | 805 | | |
803 | 806 | | |
| |||
825 | 828 | | |
826 | 829 | | |
827 | 830 | | |
828 | | - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
829 | 840 | | |
830 | | - | |
831 | | - | |
| 841 | + | |
832 | 842 | | |
833 | 843 | | |
| 844 | + | |
| 845 | + | |
834 | 846 | | |
835 | 847 | | |
836 | 848 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
| 75 | + | |
| 76 | + | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments