-
Notifications
You must be signed in to change notification settings - Fork 194
Fix Login/Signup Service Redirection Issue #465 #478
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: master
Are you sure you want to change the base?
Conversation
I've added a straightforward "Quick Setup Guide" to the README. It includes: 1) A list of things you need before getting started. 2) Simple step-by-step instructions with commands to set everything up. 3) Key configuration details you should know. 4) A direct link to the full onboarding guide for more details.
### Pull Request: Add Length Restrictions to Room Input Parameters #### Description This PR introduces length restrictions on the input parameters for the Room Title and Description fields in the `RoomInput` component. The goal is to prevent UI overflow and ensure that the application remains stable even when users attempt to input excessively long text. #### Changes Made - **Character Limits**: - Set a maximum character limit of **50** for the Room Title. - Set a maximum character limit of **200** for the Room Description. - **Input Validation**: - Implemented validation logic in the `handleTitleChange` and `handleDescriptionChange` functions to restrict input length. - Added visual feedback to users by displaying the current character count alongside the input fields. #### Motivation This change is crucial to enhance the user experience and maintain the integrity of the application. By enforcing these limits, we can prevent potential UI issues that may arise from excessively long input, ensuring that the application remains user-friendly and visually appealing. #### Linter Errors Please note that there is a linter error indicating that the module 'react' cannot be found. This may require additional setup or installation of type declarations for React in the project. #### Testing - Manually tested the input fields to ensure that the character limits are enforced correctly. - Verified that the character count updates in real-time as the user types. #### Additional Notes Please review the changes and let me know if there are any further modifications or improvements needed.
Update RoomInput.tsx
This implementation provides a basic structure for handling automatic reconnection in your LiveKit integration. You can expand upon this by adding more detailed user notifications and handling specific error cases during reconnection attempts.
1. Logout Method: Ensure the logout method clears the session and redirects the user. 2. Button Action: Verify that the button correctly calls the logout method
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.
Hello @prangowda, 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!
Summary of Changes
This pull request addresses issue #465, which involves improper redirection after login/signup actions. The primary changes involve modifying the navigation logic in the LoginScreen
and adding explicit redirection to the home screen after successful authentication. Additionally, there are updates to the PR template, README, and new files related to connection status and settings.
Highlights
- Navigation Fix: Modified navigation in
LoginScreen
fromGet.offNamed()
toGet.toNamed()
to preserve navigation history and added explicit redirection to the home screen after successful login/signup usingGet.offAllNamed()
. - Form Field Clearing: Added a
_clearFormFields()
method inLoginScreen
to clear email, password, and confirm password fields upon navigation away from the screen. - New Features: Added new files for connection management (
connection_controller.dart
,connection_status_widget.dart
) and settings screen (settings_screen.dart
) with logout functionality. - Documentation: Updated the README with a quick setup guide including prerequisites and basic setup steps.
Changelog
Click here to see the changelog
- .github/PULL_REQUEST_TEMPLATE.md
- Added a section for 'Additional Changes' to include cleanup logic for the
leaveRoom
method.
- Added a section for 'Additional Changes' to include cleanup logic for the
- README.md
- Added a 'Quick Setup Guide' section with prerequisites and basic setup steps for the project.
- app/components/RoomInput.tsx
- Created a new
RoomInput
component with title and description input fields, including character limits and display of current character count.
- Created a new
- lib/controllers/connection_controller.dart
- Created a
ConnectionController
using GetX to manage connection status and reconnection attempts.
- Created a
- lib/screens/settings_screen.dart
- Created a
SettingsScreen
with a logout button that calls theauthService.logout()
method.
- Created a
- lib/services/auth_service.dart
- Added a
logout()
method to clear the user session and redirect to the login screen usingGet.offAllNamed('/login')
.
- Added a
- lib/services/livekit_service.dart
- Created a
LiveKitService
to handle connection loss and reconnection attempts, including a reconnection loop and user notification.
- Created a
- lib/views/screens/login_screen.dart
- Replaced individual
clear()
calls with_clearFormFields()
for form fields inPopScope
'sonPopInvokedWithResult
. - Modified login button's functionality to navigate to the home screen (
AppRoutes.home
) upon successful login usingGet.offAllNamed()
. - Changed
Get.offNamed()
toGet.toNamed()
for 'Forgot Password?' and 'Register' links, preserving navigation history, and added_clearFormFields()
before navigation. - Added a
_clearFormFields()
method to clear form fields.
- Replaced individual
- lib/widgets/connection_status_widget.dart
- Created a
ConnectionStatusWidget
to display the connection status and reconnection attempts usingObx
to react to changes inConnectionController
.
- Created a
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
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 .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
A screen's redirection,
A path now clearly defined,
Home is where we go.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This PR addresses a redirection issue in the login/signup service and introduces a quick setup guide in the README. The changes in LoginScreen
improve navigation and form handling. The addition of ConnectionController
and LiveKitService
suggests enhanced connection management. Overall, the PR seems well-structured and addresses the stated issue.
Summary of Findings
- Redirection Logic: The redirection logic in
LoginScreen
has been modified to useGet.offAllNamed()
after successful login, ensuring a clean navigation stack. This addresses the original issue of improper redirection. - Form Field Clearing: The
_clearFormFields()
method inLoginScreen
is now used consistently across different navigation actions, ensuring that form fields are cleared when navigating away from the login screen. - README Quick Setup Guide: A quick setup guide has been added to the README, providing users with a simplified set of instructions to get the project up and running quickly.
Merge Readiness
The pull request addresses the stated issue and includes improvements to the login/signup redirection logic. The addition of a quick setup guide in the README is also beneficial. I recommend merging this pull request after addressing the review comments. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging.
// Implement your reconnection logic here | ||
// Return true if successful, false otherwise | ||
} |
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.
The reconnect()
method is currently empty. It should contain the actual reconnection logic. Without this, the reconnection attempts will always fail.
Future<bool> reconnect() async {
// Implement your reconnection logic here
// For example:
// try {
// await LiveKit.connect(url, token);
// return true;
// } catch (e) {
// print('Reconnection failed: $e');
// return false;
// }
return false; // Replace with actual logic
}
final success = await controller.login(); | ||
if (success) { | ||
// Navigate to home or dashboard after successful login | ||
Get.offAllNamed(AppRoutes.home); | ||
} |
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.
It would be beneficial to handle the case where success
is false. Currently, if controller.login()
fails (returns false), there is no feedback to the user. Consider adding an error message or logging the failure.
final success = await controller.login();
if (success) {
// Navigate to home or dashboard after successful login
Get.offAllNamed(AppRoutes.home);
} else {
// Handle login failure, show error message
print('Login failed'); // Replace with user-friendly message
}
void notifyUser(String message) { | ||
// Implement user notification logic here | ||
} |
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.
This PR addresses issue #465 where the login/signup service was not properly redirecting users after authentication actions.
Changes Made:
Get.offNamed()
toGet.toNamed()
to preserve navigation historyGet.offAllNamed()
Fixes #465