Skip to content
Snippets Groups Projects

some bad possible fixes for google login in cosmos

Merged stotayag requested to merge fix-issues into main
2 files
+ 11
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -4,7 +4,7 @@ Helper functions to help with authentication
import json
from typing import Union
from flask import abort, session
from flask import abort, flash, redirect, session, url_for
from google.oauth2 import id_token
from google.auth.transport import requests
from mongoengine.errors import DoesNotExist, MultipleObjectsReturned
@@ -78,6 +78,11 @@ def google_login(token: str):
except MultipleObjectsReturned:
# should not get here...
abort(400)
except Exception:
# should not get here... but some cosmosDB indexing stuff..
# Quick fix
flash("Something went wrong..", 'error')
return redirect(url_for('authentication_blueprint.login'))
return create_token_for_user(user)
Loading