respect jupyter-server disable_check_xsrf setting

allows global disable of xsrf checks in single-user servers
This commit is contained in:
Min RK
2024-03-26 08:55:15 +01:00
parent 7e56bf7e2c
commit c08b582c53

View File

@@ -987,7 +987,9 @@ class HubOAuth(HubAuth):
Applies JupyterHub check_xsrf_cookie if not token authenticated Applies JupyterHub check_xsrf_cookie if not token authenticated
""" """
if getattr(handler, '_token_authenticated', False): if getattr(handler, '_token_authenticated', False) or handler.settings.get(
"disable_check_xsrf", False
):
return return
check_xsrf_cookie(handler) check_xsrf_cookie(handler)