jupyterhub / jupyterlab-hub

Deprecated: JupyterLab extension for running JupyterLab with JupyterHub
BSD 3-Clause "New" or "Revised" License
181 stars 40 forks source link

Logout not working #51

Closed apastor closed 6 years ago

apastor commented 6 years ago

Hi,

The Logout button in the hub menu opens a new tab with the login page, but it doesn't logout the user. I have to switch from /lab to /tree in the url as commented in #40 to do the trick.

I have Jupyterhub running with a sudo user and using SudoSpawner. I had to set "hub_prefix" to "/hub" following #50 to get the "Hub" menu.

jupyter --version
4.4.0
jupyterhub --version
0.8.1

jupyter labextension list
JupyterLab v0.31.12
Known labextensions:
   app dir: /usr/local/share/jupyter/lab
@jupyterlab/hub-extension
        @jupyterlab/hub-extension v0.8.1  enabled  OK

I have no experience with node and npm, could it be something related to a node package? I get some warnings when running the command sudo jupyter labextension install @jupyterlab/hub-extension because of the react version. I have installed react@15.6.2 as global and linked in the user account. Tried to force install of react 15.0.0 but keeps installing the latest version.

warning "@jupyterlab/vdom-extension > @nteract/transform-vdom@1.1.1" has unmet peer dependency "react@^15.6.1".
warning "@jupyterlab/json-extension > react-highlighter@0.4.2" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@jupyterlab/json-extension > react-json-tree@0.10.9" has unmet peer dependency "react@^15.0.0".
warning "@jupyterlab/json-extension > react-json-tree@0.10.9" has unmet peer dependency "react-dom@^15.0.0".

Is it something known, the react version or am I missing something?

Thank you!

shyam334 commented 6 years ago

In addition to a +1, IMHO the 'hub > logout' method is a bit unintuitive, compared to a nice logout button in the corner. (like hub) Hopefully you guys will look into it sooner.

jstaf commented 6 years ago

Hmmm, you're right the user stays logged in pretty much indefinitely (even if you use the "Logout" button, close all tabs, restart the browser, etc.).

As long as you have the URL for the session, it can be accessed.

liffiton commented 6 years ago

The logout button in the old non-lab interface works for me. That is, if I go to /user/[id]/tree and press the logout button there, I am properly logged out of everything, including any /user/[id]/lab sessions.

There are apparently two different logout URLs. The jupyterlab-hub extension's logout menu item redirects to /hub/logout, which logs one out of jupyterhub but not the running jupyter server (which is still accessible via /user/[id]/lab or /user/[id]/tree. The old non-lab interface logout button redirects to /user/[id]/logout, however, which in turn redirects to /hub/logout. I expect the first URL there properly shuts down the running server as well. So it looks like a simple change of the URL here would fix this issue.

liffiton commented 6 years ago

@betatim, @minrk: I don't believe #57 fixes the issue reported here. As far as I can tell, that commit just changes how the logout URL is reached, but the issue here is that the logout URL itself is incorrect (described in an earlier comment). Apologies if I've misunderstood something.

betatim commented 6 years ago

When I am on https://example.com/user/betatim/lab, click the logout menu item, I end up on https://example.com/hub/login and indeed if I now go back to https://hdflab.hdfgroup.org/user/betatim/lab? I still get a lab session. Do you want to make a PR to fix this?

liffiton commented 6 years ago

I believe that PR should use the correct URL, but I'm afraid I am not familiar enough with JupyterLab to be certain, and I also have not been able to test it myself. I apologize for that, but I hope it's at least a starting point and easy enough to correct if needed.