"Show Logs" fails due to missing _xsrf token with JupyterHub 4
yamaton opened this issue · comments
yamato matsuoka commented
Description
"Show Logs", displaying environment build logs, does not work with the current tljh version (JupyterHub 4).
Discussion
The feature fails because the _xsrf
token, required since JupyterHub 4, is missing from the request. The tljh-repo2docker's "Show Logs" does not use JHAPI
when displaying the terminal, which means we need to handle the XSRF token explicitly.
Reference
XSRF in JupyterHub 4:
- https://discourse.jupyter.org/t/rfc-jupyterhub-removing-referer-checks/17211
- jupyterhub/jupyterhub#4032
JHAPI implementation: https://github.com/jupyterhub/jupyterhub/blob/cf69c0a4cb75ca4cb528538cfaf2f1373b129b7c/share/jupyterhub/static/js/jhapi.js