updates color generation, tries fixing credentials bug

- credentials still lost the refresh token after a certain event
  - this was now fixed by completely removing any saves past the first one
  - https://trello.com/c/iORYLYHl/44-1-check-on-credentials

- Color Coding is now updated
  - fixed an incorrect color mapping in the colors.json
  - updates some calls to functions to correctly get the natural colors
  - the incorrect red -> yellow mapping might have to do with the previous credentials error
This commit is contained in:
2020-05-17 22:59:12 +02:00
parent 1b7980e834
commit ee54dd5daa
13 changed files with 38 additions and 66 deletions

View File

@ -73,7 +73,7 @@ def verifyResponse():
flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(
CLIENT_SECRETS_FILE, scopes=SCOPES, state=state)
flow.redirect_uri = request.base_url
flow.redirect_uri = flask.url_for('callback', _external=True)
# Use the authorization server's response to fetch the OAuth 2.0 tokens.
authorization_response = flask.request.url
@ -82,9 +82,10 @@ def verifyResponse():
# Store credentials in the session.
# ACTION ITEM: In a production app, you likely want to save these
# credentials in a persistent database instead.
credentials = flow.credentials
flask.session['credentials'] = credentials_to_dict(credentials)
print(credentials_to_dict(credentials), flush=True)
session = flow.authorized_session()
return session, credentials_to_dict(credentials)