Skip to content
Snippets Groups Projects
Commit 62e112ea authored by Thomas Schneider's avatar Thomas Schneider
Browse files

auth: Exempt SAML ACS view from CSRF

parent a551fe03
No related branches found
No related tags found
1 merge request!5Auth
...@@ -33,6 +33,10 @@ def create_app(): ...@@ -33,6 +33,10 @@ def create_app():
multipass.identity_handler(identity_handler) multipass.identity_handler(identity_handler)
multipass.init_app(app) multipass.init_app(app)
for k, v in app.view_functions.items():
if k.startswith("_flaskmultipass_saml_acs_"):
csrf.exempt(v)
app.config.update( app.config.update(
{ {
"WEBPACK_LOADER": { "WEBPACK_LOADER": {
......
...@@ -101,6 +101,7 @@ def identity_handler(identity_info: IdentityInfo): ...@@ -101,6 +101,7 @@ def identity_handler(identity_info: IdentityInfo):
data=identity_info.data, data=identity_info.data,
) )
def require_login(): def require_login():
if "identity" not in session: if "identity" not in session:
return redirect(url_for("login")) return redirect(url_for("login"))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment