-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(oauth): upgraded all generic oauth plugin providers to use unqiue account ids #2870
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryAdded Key Changes:
Context: Suggestions:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant App
participant BetterAuth
participant OAuthProvider
participant Database
User->>App: Initiate OAuth flow
App->>BetterAuth: Start authentication
BetterAuth->>OAuthProvider: Redirect to authorization
OAuthProvider->>User: Request consent
User->>OAuthProvider: Grant permissions
OAuthProvider->>BetterAuth: Return authorization code
BetterAuth->>OAuthProvider: Exchange code for response
OAuthProvider->>BetterAuth: Provide response data
BetterAuth->>BetterAuth: Call getUserInfo handler
BetterAuth->>OAuthProvider: Fetch user profile
OAuthProvider->>BetterAuth: Return profile information
BetterAuth->>BetterAuth: Concat profile.sub with UUID
BetterAuth->>Database: Execute account.create.before hook
Database->>Database: SELECT existing (userId, providerId)
alt Existing Account Found
Database->>Database: UPDATE account with new accountId
Database->>BetterAuth: Return existing account
else No Existing Account
Database->>Database: INSERT new account
Database->>BetterAuth: Return new account
end
BetterAuth->>App: Return auth session
App->>User: Redirect to application
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 2 comments
Summary
Type of Change
Testing
Tested manually
Checklist