-
Notifications
You must be signed in to change notification settings - Fork 3
🔀♻️ Improve GitHub OAuth handling #21
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
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.
Pull Request Overview
Improves GitHub OAuth handling by limiting login attempts, enhancing logging and error messaging, and adding unit tests for the TokenHandler.
- Added a new testing dependency (mocktail) for unit tests.
- Updated OAuth handling and logging improvements.
- Enhanced error handling in the GitHub login button.
Files not reviewed (4)
- lib/utility/github_oauth_handler.dart: Language not supported
- lib/utility/token_handler.dart: Language not supported
- lib/widgets/github_login_button.dart: Language not supported
- test/utiltiy/token_handler_test.dart: Language not supported
…nd improve login attempt logic
Ruby11235
left a comment
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.
- When choosing to login with GitHub, you should not be sent to Browser when not clicking on 'copy code'
- Change language of said button to english
- Add max login attempts to login with token
… max login attempts
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.
Copilot reviewed 3 out of 20 changed files in this pull request and generated no comments.
Files not reviewed (17)
- lib/app.dart: Language not supported
- lib/scheme/app_color.dart: Language not supported
- lib/utility/github_oauth_handler.dart: Language not supported
- lib/utility/token_handler.dart: Language not supported
- lib/views/home_view.dart: Language not supported
- lib/views/login_github_view.dart: Language not supported
- lib/views/login_token_view.dart: Language not supported
- lib/views/login_view.dart: Language not supported
- lib/views/welcome_view.dart: Language not supported
- lib/widgets/app_bar.dart: Language not supported
- lib/widgets/app_title.dart: Language not supported
- lib/widgets/github_code_dialog.dart: Language not supported
- lib/widgets/github_login_button.dart: Language not supported
- lib/widgets/login_toke_input.dart: Language not supported
- lib/widgets/page_title.dart: Language not supported
- lib/widgets/text_link.dart: Language not supported
- test/utility/token_handler_test.dart: Language not supported
🔀♻️ Improve GitHub OAuth handling
This pull request includes several changes to improve the GitHub OAuth handling, enhance error messaging, and add unit tests for the
TokenHandlerclass. The most important changes include adding a maximum login attempt limit, improving logging, and adding mock tests for theTokenHandler.Enhancements to GitHub OAuth handling:
lib/utility/github_oauth_handler.dart: Added amaxLoginAttemptsvariable to limit the number of login attempts and updated the logging levels to be more consistent. [1] [2] [3] [4]Error messaging improvements:
lib/widgets/github_login_button.dart: Updated the login button text to "Login with GitHub" and added error handling to show a snackbar message when login fails. [1] [2]Unit tests:
test/utiltiy/token_handler_test.dart: Added unit tests for theTokenHandlerclass usingmocktailto mockFlutterSecureStorage.Dependency updates:
pubspec.yaml: Addedmocktailas a dependency for unit testing.Minor changes:
lib/utility/token_handler.dart: Removed thefinalkeyword from thestoragevariable to allow it to be mocked in tests.