Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add email provider when logging in with an email #353

Merged

Conversation

karrui
Copy link
Collaborator

@karrui karrui commented Nov 13, 2024

TL;DR

Added account record creation during email-based authentication

What changed?

  • Added transaction to create both user and account records during email sign-in
  • Implemented email provider account creation using normalized email as the provider account ID
  • Maintained existing user creation/update logic while adding the associated account record

How to test?

  1. Sign in with email authentication
  2. Verify that a new account record is created in the database with:
    • Provider set to "email"
    • ProviderAccountId set to the normalized email address
    • Correct association with the user ID

Why make this change?

To maintain consistency in authentication records across different providers and ensure proper tracking of email-based authentication methods in the accounts table. This change aligns the email authentication flow with other authentication providers' data structures.

Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
starter-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 8:03am

Copy link
Collaborator Author

karrui commented Nov 13, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @karrui and the rest of your teammates on Graphite Graphite

@karrui karrui marked this pull request as ready for review November 13, 2024 08:01
@datadog-opengovsg
Copy link

datadog-opengovsg bot commented Nov 13, 2024

Datadog Report

Branch report: 11-13-feat_add_email_provider_when_logging_in_with_an_email
Commit report: b55c0b4
Test service: starter-kit

✅ 0 Failed, 11 Passed, 0 Skipped, 10.82s Total Time
⬆️ Test Sessions change in coverage: 1 increased (+0.59%)

@karrui karrui merged commit d99ea63 into main Nov 13, 2024
13 checks passed
@karrui karrui deleted the 11-13-feat_add_email_provider_when_logging_in_with_an_email branch November 13, 2024 08:08
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