Pārlūkot izejas kodu

show error if no such email exists from Github

Son NK 5 gadi atpakaļ
vecāks
revīzija
cb3ea63066
1 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. 6 1
      app/auth/views/github.py

+ 6 - 1
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)