Allow legacy stateless tokens that were minted without a password fingerprint.

This commit is contained in:
Francis Cao committed 2026-06-23 13:24:55 -07:00
1 parent 3b792720af
commit 3888ec6f4f
2 files changed
+11 -1

No files matched your search

+9
View File
@@ -66,6 +66,15 @@ describe('checkAuth password fingerprint', () => {
expect(result?.user?.id).toBe('user-1');
});
test('authorizes a legacy stateless token that does not include a password fingerprint', async () => {
parseSecureTokenMock.mockReturnValue({ userId: 'user-1' } as any);
mockUser();
const result = await checkAuth(authedRequest());
expect(result?.user?.id).toBe('user-1');
});
test('rejects a stateless token whose fingerprint predates a password change', async () => {
// Token minted against the old password must stop working once the password changes.
parseSecureTokenMock.mockReturnValue({