I am using âstreamlit_authenticatorâ package to display login screen for my app. Itâs a nice piece of work. Thank you Mohammad Khorasani!
I need a little control over my âlogoutâ button. I want to ask the user âAre you sure you want to logout?â / âAre you sure to abandon your work?â etc.
How do I do this?
LATER
Ferdy gave a nice workaround. But as advised by Ferdy, I did raise an issue with the streamlit-authenticator package. You can find it here. Thank you @ferdy.
The solution given in that thread by the author of the package is the best solution for this.
The âlogoutâ function takes âunrenderedâ as one of the values for the âlocationâ parameter. When passed like that, it will perform the logout operation without rendering the button. So this allows us to render a button, ask for confirmation etc. and then call the actual logout() function with location parameter set to âunrenderedâ to perform the actual logout. Thatâs a neat design. Thanks to author of Streamlit-authenticator (Mr. Mohammad Khorasani)