Skip to content

fix: handle blank email from GitHub OAuth#2584

Merged
mroderick merged 1 commit intocodebar:masterfrom
mroderick:fix/blank-email-validation
Apr 22, 2026
Merged

fix: handle blank email from GitHub OAuth#2584
mroderick merged 1 commit intocodebar:masterfrom
mroderick:fix/blank-email-validation

Conversation

@mroderick
Copy link
Copy Markdown
Collaborator

@mroderick mroderick commented Apr 22, 2026

Summary

  • Validates email is present before attempting to find or create a Member
  • Shows friendly error message when GitHub returns a blank/missing email
  • Prevents ActiveRecord::RecordInvalid error with "email can't be blank, already taken, is invalid"

Root Cause

When GitHub returns a blank/nil email:

  1. Controller tried to find/create Member with blank email
  2. Found existing member with blank email in database
  3. Uniqueness validation failed with multiple errors

Fix adds early validation of email presence before any database operations.

This fixes https://app.rollbar.com/a/codebar-production/fix/item/codebar-production/663#detail

image

- Validate email is present before attempting to find or create a Member
- Show friendly error message when GitHub returns blank/missing email
- Prevents ActiveRecord::RecordInvalid error with multiple validation errors
Copy link
Copy Markdown
Contributor

@KimberleyCook KimberleyCook left a comment

Choose a reason for hiding this comment

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

🎉

@mroderick mroderick merged commit 537aac3 into codebar:master Apr 22, 2026
12 of 14 checks passed
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.

2 participants