mkhorasani / Streamlit-Authenticator

A secure authentication module to validate user credentials in a Streamlit application.
Apache License 2.0
1.38k stars 229 forks source link

Streamlit-Authenticator - Transition from login page to main page is rough #32

Closed anujwwt closed 3 months ago

anujwwt commented 1 year ago

Hi Mohamed - the transition from login page to main page for our app is very rough. i see login page for few seconds overlayed with main page which decreases the user experience. can you rectify the issue please.

mkhorasani commented 1 year ago

Hi @anujwwt, this is a known issue related to reading the reauthentication cookie. Once a solution has been found a release will be made. Regards.

roliii commented 1 year ago

Hi @anujwwt, this is a known issue related to reading the reauthentication cookie. Once a solution has been found a release will be made. Regards.

I really wait for a solution to this problem.

mkhorasani commented 1 year ago

Hi @anujwwt, still haven't found a solution to this issue. In the meantime, please feel free to take a crack at it yourself! I'd be happy to pull any changes you make. Cheers.

roliii commented 1 year ago

@anujwwt @mkhorasani I managed to get round the appearance of the form every time, there is a problem when logging in, but that's a detail. with st.spinner('Loading...'): time.sleep(0.2) name, authentication_status, username = authenticator.login('Login', 'main') Perhaps it would be possible to make a login page to which the application redirects if someone is not logged in. I managed to carve out a registration page, but that's not a good solution either.

vovavili commented 1 year ago

@anujwwt @mkhorasani The best way to do this is to put login forms inside of st.empty() container, then once you're logged in destroy the container with container.empty(), and then, in order to bypass a bug in Streamlit, sleep for a hundredth of second - time.sleep(0.01). This makes logged out -> logged in transition extremely smooth.

mkhorasani commented 3 months ago

Dear all please check the latest release v0.3.2.