6d583e72 days ago17 lines · 673 B| 1 | import { describe, expect, it } from 'vitest'; |
| 2 | |
| 3 | import { hashRefreshToken, newRefreshToken |
| 4 | |
| 5 | describe('refresh tokens', () |
| 6 | it('are ghost_rt_ followed by 32 random bytes, base64url', |
| 7 | const token = |
| 8 | expect(token).toMatch |
| 9 | expect(newRefreshToken()).not |
| 10 | }); |
| 11 | |
| 12 | it('hash to a stable sha256 hex digest', |
| 13 | expect(hashRefreshToken('ghost_rt_x |
| 14 | expect(hashRefreshToken('ghost_rt_x |
| 15 | expect(hashRefreshToken('ghost_rt_y |
| 16 | }); |
| 17 | }); |