Skip to content

Commit

Permalink
docs: add extra details about using state value
Browse files Browse the repository at this point in the history
  • Loading branch information
mblackgeo authored Mar 31, 2022
1 parent 26ad95f commit 8195ef0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ def login():
# A simple route that will redirect to the Cognito Hosted UI.
# No logic is required as the decorator handles the redirect to the Cognito
# hosted UI for the user to sign in.
# An optional "state" value can be set in the current session which will
# be passed and then used in the postlogin route (after the user has logged
# into the Cognito hosted UI); this could be used for dynamic redirects,
# for example, set `session['state'] = "some_custom_value"` before passing
# the user to this route
pass


Expand All @@ -68,7 +73,9 @@ def postlogin():
# The decorator will store the validated access token in a HTTP only cookie
# and the user claims and info are stored in the Flask session:
# session["claims"] and session["user_info"].
# Do anything after the user has logged in here, e.g. a redirect
# Do anything after the user has logged in here, e.g. a redirect or perform
# logic based on a custom `session['state']` value if that was set before
# login
return redirect(url_for("claims"))


Expand Down

0 comments on commit 8195ef0

Please sign in to comment.