Skip to content
Snippets Groups Projects
Commit 9b8e539a authored by Mart van Santen's avatar Mart van Santen
Browse files

Wipe cookies on conflict during login

parent efe8ff75
No related branches found
No related tags found
1 merge request!95Resolve "Fix consent requests"
Pipeline #37655 passed with stages
in 2 minutes and 53 seconds
...@@ -228,15 +228,21 @@ def auth(): ...@@ -228,15 +228,21 @@ def auth():
# Authorize the user # Authorize the user
# False positive: pylint: disable=no-member # False positive: pylint: disable=no-member
redirect_to = hydra_admin_api.accept_login_request(
challenge, try:
accept_login_request=AcceptLoginRequest( redirect_to = hydra_admin_api.accept_login_request(
identity.id, challenge,
remember=True, accept_login_request=AcceptLoginRequest(
# Remember session for 7d identity.id,
remember_for=60 * 60 * 24 * 7, remember=True,
) # Remember session for 7d
).redirect_to remember_for=60 * 60 * 24 * 7,
)
).redirect_to
except Exception as e:
current_app.logger.error("Failure during accepting login request. Redirecting to logout, hopefully to wipe cookies")
current_app.logger.error(e)
return redirect("logout")
return redirect(redirect_to) return redirect(redirect_to)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment