show error if no such email exists from Github

This commit is contained in:
Son NK 2020-03-05 16:46:02 +01:00
parent 90dc05725a
commit cb3ea63066
1 changed files with 6 additions and 1 deletions

View File

@ -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)