Skip to content

Commit

Permalink
Merge 22641c7 into d2c1258
Browse files Browse the repository at this point in the history
  • Loading branch information
BinamB committed Aug 13, 2020
2 parents d2c1258 + 22641c7 commit b3a3334
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fence/blueprints/login/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ def __init__(self, idp_name, client, username_field="email"):
self.username_field = username_field

def get(self):

if flask.request.args.get("error"):
# Check if user granted access
path_to_add = flask.request.full_path[flask.request.full_path.find("?") :]
location = flask.session.get("redirect") or config["BASE_URL"]
return flask.redirect(location=location + path_to_add)

code = flask.request.args.get("code")
result = self.client.get_user_id(code)
username = result.get(self.username_field)
Expand Down

0 comments on commit b3a3334

Please sign in to comment.