diff --git a/app/auth/views/facebook.py b/app/auth/views/facebook.py index ecd1e2e9..07142eb2 100644 --- a/app/auth/views/facebook.py +++ b/app/auth/views/facebook.py @@ -48,6 +48,11 @@ def facebook_login(): @auth_bp.route("/facebook/callback") def facebook_callback(): + # user clicks on cancel + if "error" in request.args: + flash("please use another sign in method then", "warning") + return redirect("/") + facebook = OAuth2Session( FACEBOOK_CLIENT_ID, state=session["oauth_state"], diff --git a/app/auth/views/github.py b/app/auth/views/github.py index e4eea08f..6ae688fb 100644 --- a/app/auth/views/github.py +++ b/app/auth/views/github.py @@ -39,6 +39,11 @@ def github_login(): @auth_bp.route("/github/callback") def github_callback(): + # user clicks on cancel + if "error" in request.args: + flash("please use another sign in method then", "warning") + return redirect("/") + github = OAuth2Session( GITHUB_CLIENT_ID, state=session["oauth_state"], diff --git a/app/auth/views/google.py b/app/auth/views/google.py index dc1db76d..8113ffe0 100644 --- a/app/auth/views/google.py +++ b/app/auth/views/google.py @@ -48,6 +48,11 @@ def google_login(): @auth_bp.route("/google/callback") def google_callback(): + # user clicks on cancel + if "error" in request.args: + flash("please use another sign in method then", "warning") + return redirect("/") + google = OAuth2Session( GOOGLE_CLIENT_ID, state=session["oauth_state"],