handle the case user clicks on cancel

This commit is contained in:
Son NK 2019-07-11 20:14:18 +02:00 committed by Son NK
parent abda0091ce
commit 631e251d8c
3 changed files with 15 additions and 0 deletions

View File

@ -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"],

View File

@ -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"],

View File

@ -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"],