[fix] No internal server error when trying to Google Auth an unregistered user (#1109)

This commit is contained in:
iTitou 2018-03-21 16:14:54 +01:00 committed by kevgliss
parent 48d9a3ec8a
commit 08f66df860

View File

@ -433,7 +433,7 @@ class Google(Resource):
user = user_service.get_by_email(profile['email'])
if not user.active:
if not (user and user.active):
metrics.send('login', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
return dict(message='The supplied credentials are invalid.'), 403