Skip to content

Fix: netid not passing to Junction Engine#23

Merged
DIodide merged 1 commit intostagingfrom
fix/netid-passing
Apr 1, 2026
Merged

Fix: netid not passing to Junction Engine#23
DIodide merged 1 commit intostagingfrom
fix/netid-passing

Conversation

@DIodide
Copy link
Copy Markdown
Owner

@DIodide DIodide commented Apr 1, 2026

Problem

The x-user-netid header was never being sent because extract_princeton_netid() couldn't find the email claim in the JWT. The frontend was calling getToken() without a template, which returns Clerk's default session token (contains sub but not email).

Fix

Use getToken({ template: "convex" }) which returns the Convex JWT template that includes the email claim. The backend then extracts the netid from emailia8920@princeton.eduia8920.

One-line change

- const token = await getToken();
+ const token = await getToken({ template: "convex" });

🤖 Generated with Claude Code

…laim

The frontend was calling getToken() without a template, which returns
Clerk's default session token (no email claim). The backend's
extract_princeton_netid() needs the email to derive the netid.

Fix: use getToken({ template: "convex" }) which includes the email
claim configured in the Clerk JWT template.

Also add debug logging when netid extraction fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@DIodide DIodide merged commit e38ceae into staging Apr 1, 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.

1 participant