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

Attempt to fix login redirect behaviors #211

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Commits on Dec 18, 2023

  1. Attempt to fix login redirect behaviors

    Must be tested behind proxy to know if it works. I identified two
    problems here:
    
    1) `flask-dance` was redirecting to `/` by default, but the app in
       production is hosted behind a proxy at `/apps/benefit-tool`. We need
       to generate the correct URL with `url_for` for the proxy to be taken
       in to account.
    2) The old login route needs to be hit twice to actually log in a user.
       The first time through, it sends the user to Google, and at the end
       of that, the user winds back up in the app without having hit the
       `login_user()` call. At this point, Google has authorized the user,
       so when they hit `/login` again, they'll hit the `login_user()` call.
    
    Both of these problems are addressed by hooking the `oauth_authorized`
    signal (https://flask-dance.readthedocs.io/en/latest/signals.html) and
    moving the login & user-insertion behavior there.
    
    Resolves #178
    Resolves #58
    mfisher87 committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    3334099 View commit details
    Browse the repository at this point in the history