mirror of
https://github.com/simple-login/app.git
synced 2024-09-30 05:31:30 +02:00
handle the case user clicks on cancel
This commit is contained in:
parent
abda0091ce
commit
631e251d8c
@ -48,6 +48,11 @@ def facebook_login():
|
|||||||
|
|
||||||
@auth_bp.route("/facebook/callback")
|
@auth_bp.route("/facebook/callback")
|
||||||
def 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 = OAuth2Session(
|
||||||
FACEBOOK_CLIENT_ID,
|
FACEBOOK_CLIENT_ID,
|
||||||
state=session["oauth_state"],
|
state=session["oauth_state"],
|
||||||
|
@ -39,6 +39,11 @@ def github_login():
|
|||||||
|
|
||||||
@auth_bp.route("/github/callback")
|
@auth_bp.route("/github/callback")
|
||||||
def 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 = OAuth2Session(
|
||||||
GITHUB_CLIENT_ID,
|
GITHUB_CLIENT_ID,
|
||||||
state=session["oauth_state"],
|
state=session["oauth_state"],
|
||||||
|
@ -48,6 +48,11 @@ def google_login():
|
|||||||
|
|
||||||
@auth_bp.route("/google/callback")
|
@auth_bp.route("/google/callback")
|
||||||
def 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 = OAuth2Session(
|
||||||
GOOGLE_CLIENT_ID,
|
GOOGLE_CLIENT_ID,
|
||||||
state=session["oauth_state"],
|
state=session["oauth_state"],
|
||||||
|
Loading…
Reference in New Issue
Block a user