Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information