-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New style multipage application refresh on a subpage routes back to default when authenticator is implemented #179
Comments
Hi @ShaunHide17, thank you for reaching out. Instead of using this custom function, can you try to add an |
Hi @mkhorasani , thanks for the quick reply and the help! Sadly adding in the I think the new routing causes a multipage visit on the first I supply the key parameter to Full error log below:
|
It seems that you are recreating several |
can you help me understand a little bit here. when authenticator object is saved to the session state, and when user refreshes the page, wouldn't it loose the state? |
Hi @smboy, session_state will only be lost if the user does a hard refresh. A normal refresh will not remove the session_state. But even if the user does a hard refresh the re-authentication cookie will log them in automatically. I hope this answers your question. |
Thanks for the details. Couple of followup questions:
Thanks again! |
Hi @smboy, can you verify that the issue you had was resolved after adding the |
It seems to be working on a standalone code. I will add it to my application and will update you (I was using a different authentication module which was having similar issues of persistence during page refresh). meanwhile, anyway to customize the login? I would like to only display email and pwd..username is not required for my application. Thanks much again for your quick response! |
Yes, as of the latest version, users can now register their email as their username too. Feel free to change the name of the username field to email if you wish, you can do so using the |
@mkhorasani this is a great new feature! I am trying to keep things simple for my users and just have email and password, so this helps. I have this working on the login widget, however, can't get it working on register_user. When running |
Since the |
If I may suggest, what would be appropriate is to take input fields as config parameter for registration and login. For instance, for registration, I want to use {user_email, pwd, company_name} and for login {username, password}. In fact, what I was thinking is to even isolate further. If there is any clean way where I can come up with my own login screen and simply pass the values to your application, that would be even ideal. That way, we are separating the front end with that of the backend. Its upto user on what and how they customize the login screen with. Currently its tightly coupled with the login screen. |
I definitely see a use case for this, but it would require major refactoring of the codebase and that is something that I can only commit to for the long term. |
i am still having the case where my page reloads to the default page, i have updated to the last version, provided authentication on the entry file, added the authenticator = st.session_state.authenticator and authenticator.login("unrendered") to every page, my app still reloads to default or main page |
Hi,
I am using the latest version of streamlit-authenticator (0.3.3) with the latest version of streamlit (1.37.0)
I am using the new multipage routing mechanism that streamlit recently released:
https://docs.streamlit.io/develop/concepts/multipage-apps/page-and-navigation
If I navigate away from the default page (View) to View2 then do a hard refresh (i.e. F5), it refreshes back to the default page (View) rather than the page I refreshed on. This behaviour does not occur without the
instantiate_authenticator()
function call so cant seem to work out what is driving the return to default behaviourCan you offer any guidance?
Here is a sample of the main file from which the application is started with
streamlit run
With the instantiate_authenticator() function being:
The text was updated successfully, but these errors were encountered: