Fix JWT sub claim to use GitHub profile URL instead of API URL

The sub claim was set to https://api.github.com/user/{id} (numeric ID),
but the API-side username extractor splits on '/' expecting a login name.
Use https://github.com/{login} so the extracted segment matches the
allowed_usernames config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-03 16:41:33 -05:00
parent fca63cb2e7
commit 518b6ab9ac

View file

@ -49,7 +49,7 @@ export async function loader({ request }: Route.LoaderArgs) {
}
const session = await getSession(request);
session.set("userUrl", `https://api.github.com/user/${profile.id}`);
session.set("userUrl", `https://github.com/${profile.login}`);
session.set("githubId", profile.id);
session.set("githubNodeId", profile.node_id);
session.set("githubLogin", profile.login);