feat(oauth): upgraded all generic oauth plugin providers to use unqiue account ids#2870
feat(oauth): upgraded all generic oauth plugin providers to use unqiue account ids#2870waleedlatif1 merged 1 commit intostagingfrom
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
|
Summary
Type of Change
Testing
Tested manually
Checklist