plasmabio / tljh-repo2docker

Plugin for The Littlest JupyterHub to build multiple user environments with repo2docker
BSD 3-Clause "New" or "Revised" License
60 stars 15 forks source link

"Show Logs" fails due to missing _xsrf token with JupyterHub 4 #60

Closed yamaton closed 10 months ago

yamaton commented 10 months ago

Description

"Show Logs", displaying environment build logs, does not work with the current tljh version (JupyterHub 4).

Screenshot 2023-11-08 170307

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:

JHAPI implementation: https://github.com/jupyterhub/jupyterhub/blob/cf69c0a4cb75ca4cb528538cfaf2f1373b129b7c/share/jupyterhub/static/js/jhapi.js