diff --git a/app/auth/utils.py b/app/auth/utils.py index fb9c327e4..12a8959e2 100644 --- a/app/auth/utils.py +++ b/app/auth/utils.py @@ -114,8 +114,9 @@ def find_user_by_email(email): ).first() return user if user.agencies.all() else None elif current_app.config['USE_OAUTH']: + from sqlalchemy import func return Users.query.filter( - Users.email == email, + func.lower(Users.email) == email.lower(), Users.auth_user_type.in_(user_type_auth.AGENCY_USER_TYPES) ).first() return None