Skip to content

Fix Unknown User#122

Open
samlambert wants to merge 2 commits intomainfrom
fix-anon
Open

Fix Unknown User#122
samlambert wants to merge 2 commits intomainfrom
fix-anon

Conversation

@samlambert
Copy link
Copy Markdown
Collaborator

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beam Ready Ready Preview, Comment Apr 7, 2026 0:25am

Request Review

@samlambert
Copy link
Copy Markdown
Collaborator Author

cc @joshmgross

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5f48759. Configure here.

name:
profileWithName?.name ??
profileWithName?.preferred_username ??
profileWithName?.login,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nullish coalescing skips fallback for empty string names

Medium Severity

The ?? (nullish coalescing) operator only falls through on null/undefined, not on empty strings. If profileWithName?.name is "" (which some OAuth providers return instead of null for unset names), the preferred_username and login fallbacks are skipped entirely. The || operator would correctly fall through for empty strings, preserving the intended fallback chain of name → preferred_username → login.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5f48759. Configure here.

where: { id: user.id },
data: { name: fallbackName },
})
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unhandled DB error in signIn blocks authentication

Medium Severity

The prisma.user.update call inside the signIn callback isn't wrapped in a try-catch. If this database update fails (e.g., transient DB error), the unhandled exception propagates up and causes the entire sign-in to fail. Since the name update is a cosmetic enhancement, it shouldn't block user authentication.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5f48759. Configure here.

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