From cb3ea6306641934fc709604a5ab02634260af0cf Mon Sep 17 00:00:00 2001 From: Son NK Date: Thu, 5 Mar 2020 16:46:02 +0100 Subject: [PATCH] show error if no such email exists from Github --- app/auth/views/github.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/auth/views/github.py b/app/auth/views/github.py index 7afb392c..73dc25b9 100644 --- a/app/auth/views/github.py +++ b/app/auth/views/github.py @@ -78,7 +78,12 @@ def github_callback(): break if not email: - raise Exception("cannot get email for github user") + LOG.error(f"cannot get email for github user {github_user_data} {emails}") + flash( + "Cannot get a valid email from Github, please another way to login/sign up", + "error", + ) + return redirect(url_for("auth.login")) email = email.lower() user = User.get_by(email=email)