jupyterlab/jupyterlab

Logout button cannot be hidden

Open

#6300 opened on May 2, 2019

View on GitHub
 (4 comments) (0 reactions) (0 assignees)TypeScript (13,454 stars) (2,937 forks)batch import
enhancementhelp wantedtag:Feature Parity

Description

Describe the enhancement

Hey, this is an enhancement.

I was looking at the Logout behaviour in the classical notebook because I was surprised by the PR #6087 not having a way to hide it as for the Shut down button. Actually, it will not appear in the menu if the server option quit_button is True. But this is not coherent with the classical notebook.

In the classical notebook, the Login/Logout buttons display depends on logged_in and login_available properties of AuthenticatedHandler.

https://github.com/jupyter/notebook/blob/9560e0cf4c3a3612f7e0f869035e7e3eeb5853a0/notebook/templates/page.html#L139-L145

https://github.com/jupyter/notebook/blob/9560e0cf4c3a3612f7e0f869035e7e3eeb5853a0/notebook/base/handlers.py#L174-L177

https://github.com/jupyter/notebook/blob/9560e0cf4c3a3612f7e0f869035e7e3eeb5853a0/notebook/base/handlers.py#L184-L194

Those parameters are passed to the jinja template as parameters.

Basically if the user equals "anonymous", those buttons should be hidden. This can be obtain by customizing the login handler class.

Now the question is how to apply a similar behaviour in JupyterLab. I presume the main point is to figure out how to send the information to the frontend through the page_config_data as for the Shut down button.

https://github.com/jupyterlab/jupyterlab/blob/0af6067a79b054a8289dd11649204d03b2bde90a/jupyterlab/labapp.py#L382

Contributor guide