You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
signSession and verifySession in lib/auth.ts issue and check the portal's session tokens.
There are no tests for it yet.
Cover at least
sign then verify gives back the same claims
undefined, "" and garbage → null
a token with one character changed → null
a token signed with a different secret → null (set process.env.JWT_SECRET inside the test and restore it afterwards)
an expired token → null, using Vitest's fake timers (vi.useFakeTimers())
How
Create lib/auth.test.ts next to the code. Follow the style of lib/github-auth.test.ts.
Run npm test. Then break the code on purpose (flip a condition) and watch at least one of your tests fail. Paste that failure output in the PR description, then undo the break.
Test behaviour through the exported function only. Don't change the source file unless you find a bug, and if you do, stop and comment on this issue first.
Size: ~30–60 lines of tests, 0 lines of source.
Taking this? Comment /assign and the bot assigns you if it's free. One issue per person at a time; comment /unassign to hand it back. That's milestone 2 of the 10 PR Journey. Setup, the checks CI runs, and how to open the PR from your fork are in CONTRIBUTING.md. Put Fixes #<this issue> in your PR description.
Activity
Anshsaxena07 commentedon Sep 23, 2026
/assign
github-actions commentedon Sep 23, 2026
@Anshsaxena07 it's yours! 🎉
main, withFixes #104in the description.Can't finish it? Comment
/unassignso someone else can pick it up.Anshsaxena07 commentedon Sep 24, 2026
/unassign
github-actions commentedon Sep 24, 2026
@Anshsaxena07 you've been unassigned. This issue is open for someone else to pick up.
prachidarshi-2307 commentedon Sep 27, 2026
/assign
github-actions commentedon Sep 27, 2026
@prachidarshi-2307 it's yours! 🎉
main, withFixes #104in the description.Can't finish it? Comment
/unassignso someone else can pick it up.