Skip to content
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

Fix logging in after logging out + other navigation to main page #104

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

helenxuyang
Copy link
Contributor

@helenxuyang helenxuyang commented Nov 16, 2022

Summary

Trello task: Logging in doesn't work after logging out

Original issue: logging in after logging out would sign in correctly using Google, but would not navigate to the home page.

Root cause: the sign out button needs to navigate to Logic, not Login. Logic contains a Login as well as the home/onboarding widgets, and listens for changes to the authentication provider, which is what allows logging into navigate to the home/onboarding page.

Follow ups:

  • Refactored classes in main_common to clean up first time login logic because it was kind of a mess
    • Renamed Logic to Main (for clarity)
    • Combined HomeOrOnBoarding class into Main (for simplification)
    • Changed Main into stateless widget that uses a FutureBuilder for checking first time login instead of super stateful widget with super sus 3 sec timer
  • Added asyncs and awaits in Profile, Login, and AuthProvider (for safety with asynchronous code)
  • Changed sign out button's navigation to use pushAndRemoveUntil so that it removes all pages and pushes a Main (fixes issue where you can't log in after logging out)
  • Changed ride confirmation button's navigation to use popUntil with the first route instead of a named route
  • Changed all navigation to named '/' route to go until first route (fixes issue where you navigate to a black screen)

Test Plan

Test each of the following with both a new user and a returning user (to make sure navigating back to the homepage/login is correct even with onboarding)

  • Log out and in (should navigate back to login page, then to home page)
  • Finish requesting ride (should navigate back to home page)
  • Finish cancelling a ride (should navigate back to home page)
  • Cancel in middle of creating ride (should navigate back to home page)

Log in and log out (as new and returning user)

  1. New user login -> confirm we see onboarding
  2. Log out -> confirm navigate to login page
  3. Log in -> confirm navigate to home page
  4. Returning user login -> confirm navigate to home page
  5. Log out -> confirm navigate to login page
  6. Log in -> confirm navigate to home page
Record_2022-11-15-20-39-39.mp4

Finish requesting ride

  1. New user login -> confirm we see onboarding
  2. Request a ride -> confirm navigates back to home page
  3. Log out -> confirm navigates back to login page
  4. Returning user login -> confirm navigate to home page
  5. Request a ride -> confirm navigates back to home page
  6. Log out -> confirm navigates back to login page
Record_2022-11-15-20-43-04.mp4

Finish cancelling ride

  1. New user login -> confirm we see onboarding
  2. Cancel a ride -> confirm navigates back to home page
  3. Returning user login -> confirm navigate to home page
  4. Cancel a ride -> confirm navigates back to home page
Record_2022-11-16-19-45-31.mp4

Cancel in middle of requesting ride

  1. New user login -> confirm we see onboarding
  2. Start requesting a ride but cancel out of it -> confirm navigates back to home page
  3. Returning user login -> confirm navigate to home page
  4. Start requesting a ride but cancel out of it -> confirm navigates back to home page
Record_2022-11-16-19-50-48.mp4

Notes

@dti-github-bot
Copy link
Member

dti-github-bot commented Nov 16, 2022

[diff-counting] Significant lines: 92.

@helenxuyang helenxuyang changed the title [WIP] Fix logging in after logging out Fix logging in after logging out + other navigation to main page Nov 17, 2022
@helenxuyang helenxuyang marked this pull request as ready for review November 17, 2022 00:57
@helenxuyang helenxuyang requested a review from a team as a code owner November 17, 2022 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants