[fix] No internal server error when trying to Google Auth an unregistered user (#1109)
This commit is contained in:
parent
48d9a3ec8a
commit
08f66df860
|
@ -433,7 +433,7 @@ class Google(Resource):
|
||||||
|
|
||||||
user = user_service.get_by_email(profile['email'])
|
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})
|
metrics.send('login', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS})
|
||||||
return dict(message='The supplied credentials are invalid.'), 403
|
return dict(message='The supplied credentials are invalid.'), 403
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue