block website logins that have no corresponding user profile#74
Conversation
|
Caution Review failedPull request was closed or merged during review WalkthroughBackend authentication now validates user status, blocking deactivated users at two checkpoints: existing linked accounts and first-time login resolution. Frontend implements corresponding state management to track access status ( Changes
Sequence DiagramsequenceDiagram
participant User
participant Frontend
participant Auth0
participant Backend as Backend<br/>(get_or_link_user)
participant DB as Database
User->>Frontend: Initiate login
Frontend->>Auth0: Redirect to Auth0
Auth0->>User: Display login form
User->>Auth0: Submit credentials
Auth0->>Frontend: Return auth code
Frontend->>Auth0: Exchange code for token + userinfo
Auth0->>Frontend: Return tokens & userinfo
Frontend->>Backend: POST /auth/login with auth0_sub
Backend->>DB: Query user by auth0_sub<br/>or email from userinfo
alt User active
DB->>Backend: Return active user
Backend->>Frontend: Return user data
Frontend->>Frontend: Set status: 'authorized'
Frontend->>User: Render AuthorizedApp
else User inactive/deactivated
DB->>Backend: Return inactive user
Backend->>Frontend: Raise LookupError
Frontend->>Frontend: Set status: 'blocked'
Frontend->>User: Render AccessDenied
else No user record
DB->>Backend: No record found
Backend->>Frontend: Raise LookupError
Frontend->>Frontend: Set status: 'error'
Frontend->>User: Display error message
end
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
title
Type of Change
What Changed?
Testing & Validation
How this was tested
Screenshots/Recordings
Notes & Nuances
Reviewer Notes
Summary by CodeRabbit
New Features
Bug Fixes
Improvements