Skip to content

fix: Social sign-in users bypass email verification#189

Closed
bobbyonmagic wants to merge 1 commit intothedevdojo:mainfrom
bobbyonmagic:fix/social-signin-email-verification
Closed

fix: Social sign-in users bypass email verification#189
bobbyonmagic wants to merge 1 commit intothedevdojo:mainfrom
bobbyonmagic:fix/social-signin-email-verification

Conversation

@bobbyonmagic
Copy link
Contributor

When an existing user with unverified email links their account via social sign-in, their email is now automatically marked as verified.

Social providers (Google, GitHub, etc.) already verify email addresses, so users signing in via social should be considered verified.

Changes

  • SocialController.php — When existing user links social account, email_verified_at is set if null
  • SocialAuthTest.php — Added 3 tests for email verification behavior

Why

Previously, if a user registered via email but didn't verify their email, they would still be prompted to verify after linking a social account. This is confusing UX since social providers already verify email addresses.

Testing

  • New users via social: email_verified_at is set (already worked)
  • Existing unverified users linking social: email_verified_at is now set
  • Existing verified users linking social: original timestamp preserved

When an existing user with unverified email links their account via
social sign-in, their email is now automatically marked as verified.

Social providers (Google, GitHub, etc.) already verify email addresses,
so users signing in via social should be considered verified.

Changes:
- Mark email as verified when existing user links social account
- New users created via social already have email_verified_at set
- Added tests for social auth email verification behavior
@bobbyiliev bobbyiliev closed this Jan 28, 2026
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