Login after Logging out

Currently using Panel v1.3.6
I managed to implement the logout button and successfully leave the webapp’s main page. code:

logout_btn = pn.widgets.Button(name='Logout')
logout_btn.js_on_click(code="window.location.href = '/logout'")

However, when I relogin using the button provided in panel. It takes me back directly to the main webapp whereas I believe it should ask me again about my login credentials. I am using the GenericProvider for the authentication/authorization steps. It seems I need to clear something out but even with that I can’t seem to make it work. Below is an example of how I’m solving this clearance on on_session_destroyed method:

def session_clear(session_context):
    pn.state.clear_caches()

pn.state.on_session_destroyed = session_clear

Would appreciated your guidance on this. Where am I going wrong?

1 Like

Hi @simonay

I think the experts in auth frequent Github more. Try filing this as a feature request. For example either as a bug or just as improved documentation for this use case.