- 
                Notifications
    You must be signed in to change notification settings 
- Fork 142
fix: add toast error for unknown errors on login #630
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
base: main
Are you sure you want to change the base?
Conversation
| WalkthroughError handling enhancements added to the login page component. Social sign-in mutation and email OTP submission flows now wrapped in try/catch blocks, returning response data on success and displaying toast notifications on failures. Changes
 Sequence Diagram(s)sequenceDiagram
    participant User
    participant LoginComponent as Login Component
    participant API as Auth API
    participant Toast as Toast Service
    rect rgb(200, 220, 240)
    Note over LoginComponent,Toast: Social Sign-In Flow (New)
    User->>LoginComponent: Trigger social sign-in
    LoginComponent->>API: Mutation request
    alt Success
        API-->>LoginComponent: response.data
        LoginComponent-->>User: Return response data
    else Error
        API-->>LoginComponent: Error thrown
        LoginComponent->>Toast: Show UNKNOWN_ERROR
        Toast-->>User: Display error toast
    end
    end
    rect rgb(220, 240, 220)
    Note over LoginComponent,Toast: Email OTP Submission Flow (New)
    User->>LoginComponent: Submit OTP
    LoginComponent->>API: OTP verification request
    alt Success
        API-->>LoginComponent: Success response
        LoginComponent->>LoginComponent: Navigate to /login/verify
    else Error or API Error
        API-->>LoginComponent: Error
        LoginComponent->>Toast: Show error/UNKNOWN_ERROR
        Toast-->>User: Display error toast
        LoginComponent->>LoginComponent: Return early
    end
    end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
 ✅ Passed checks (2 passed)
 ✨ Finishing touches
 🧪 Generate unit tests (beta)
 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
 ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
 🔇 Additional comments (1)
 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  | 
| 
 | 



Summary by CodeRabbit