feat(auth): Integrate auth api and session restoration#41
feat(auth): Integrate auth api and session restoration#41
Conversation
syed-tp
commented
Mar 20, 2026
- Implement AuthRepository with local storage and Dio service.
- Add session restoration at startup and persistent auth state.
- Wire auth state into router redirects and login screens.
Implement AuthRepository with local storage and Dio service. Add session restoration at startup and persistent auth state. Wire auth state into router redirects and login screens.
… and remove `flutter_dotenv` for simplified configuration.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly upgrades the application's authentication system by transitioning from a mock-driven setup to a robust, API-backed flow. It establishes persistent user sessions through secure token storage and seamlessly integrates this real-time authentication state with the application's navigation logic and user interface, ensuring a more secure and production-ready user experience. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully integrates a full API-backed authentication flow, replacing the previous mock implementation. It introduces an AuthApiService for network calls, AuthLocalDataSource for secure token storage, and an AuthRepository to manage them. The AuthProvider and GoRouter have been updated to handle asynchronous session restoration and state-based redirects, which is a solid improvement. My feedback focuses on improving type safety in the API service, simplifying state management logic in the AuthProvider, and removing some unused code for better maintainability.
- Strictly use 'token' key in Auth API response parsing. - Update design specs to reflect correct token policy field.
…remove `shouldIgnoreLogoutError` utility.
…r network requests.
…entication redirects and app initialization.
…te initial location to onboarding, and remove explicit post-logout navigation.
…trategy in the design document.
…of user data (`UserDto?`), and update related screens and providers to reflect this change.
…ntication handling.
…, refactor user repository to profile package, and update related data models and screens.
…nd implement it in login and OTP screens.