Summary
The GitHub OAuth onboarding flow assumes GitHub usernames can be mapped directly into DevCard usernames.
When a GitHub username already exists within DevCard, first-time authentication may fail even though the accounts belong to different users.
Affected Files
Root Cause
The onboarding flow attempts to create user records using GitHub-derived usernames without sufficient collision handling.
When the username already exists, account creation fails despite the user being otherwise valid.
Reproduction
- Create a DevCard account using a specific username.
- Attempt GitHub OAuth login from a different GitHub account using the same username.
- Observe account creation failure.
- Verify that the email and GitHub account are otherwise valid.
Expected Behavior
Username collisions should be resolved gracefully.
Actual Behavior
Authentication fails because the username is already taken.
Why This Is Difficult To Detect
Most testing uses unique accounts.
The issue only appears when usernames overlap.
Production Impact
- Failed onboarding
- User frustration
- Prevented GitHub adoption
- Support burden
Suggested Fix
Introduce deterministic username conflict resolution during onboarding.
Severity
Medium-High
Summary
The GitHub OAuth onboarding flow assumes GitHub usernames can be mapped directly into DevCard usernames.
When a GitHub username already exists within DevCard, first-time authentication may fail even though the accounts belong to different users.
Affected Files
Root Cause
The onboarding flow attempts to create user records using GitHub-derived usernames without sufficient collision handling.
When the username already exists, account creation fails despite the user being otherwise valid.
Reproduction
Expected Behavior
Username collisions should be resolved gracefully.
Actual Behavior
Authentication fails because the username is already taken.
Why This Is Difficult To Detect
Most testing uses unique accounts.
The issue only appears when usernames overlap.
Production Impact
Suggested Fix
Introduce deterministic username conflict resolution during onboarding.
Severity
Medium-High