Skip to content

[ShanaBoo] Registration token subject should match returned user id#6513

Open
genesisrevelationinc-debug wants to merge 11 commits into
SecureBananaLabs:mainfrom
genesisrevelationinc-debug:shanaboo-fix-2768
Open

[ShanaBoo] Registration token subject should match returned user id#6513
genesisrevelationinc-debug wants to merge 11 commits into
SecureBananaLabs:mainfrom
genesisrevelationinc-debug:shanaboo-fix-2768

Conversation

@genesisrevelationinc-debug

Copy link
Copy Markdown

ShanaBoo Autonomous Fix

This PR was automatically generated by ShanaBoo Earn Engine to claim the $780.00 bounty on this issue.

Source: Github | Task: 4557148612

Closes #2768


Auto-submitted by ShanaBoo CNS — NVIDIA NIM + Microsoft Agent Framework

Copilot AI review requested due to automatic review settings June 10, 2026 15:40
github-actions Bot added a commit that referenced this pull request Jun 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR refactors registerUser to reuse a single generated userId for both the returned user object and the access token subject, improving internal consistency.

Changes:

  • Generate userId once and reuse it for id and JWT sub
  • Update token issuance to reference the generated userId
  • (Introduced) an extra trailing brace at end of file, causing a syntax error

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

export async function refreshToken() {
return { token: signAccessToken({ sub: "usr_existing", role: "client" }) };
}
}
Comment on lines 8 to +10
email: payload.email,
role: payload.role,
token: signAccessToken({ sub: `usr_${Date.now()}`, role: payload.role })
token: signAccessToken({ sub: userId, role: payload.role })
Comment on lines +4 to +10
const userId = `usr_${Date.now()}`;
// TODO: persist new user via Prisma
return {
id: `usr_${Date.now()}`,
id: userId,
email: payload.email,
role: payload.role,
token: signAccessToken({ sub: `usr_${Date.now()}`, role: payload.role })
token: signAccessToken({ sub: userId, role: payload.role })
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.

Registration token subject should match returned user id

2 participants