Authenticators in different pages

Hello everyone,
In my app I need to create two different authenticators for two different pages.
In the “app.py” I have the following code:

if name == “main”:
configure_logging()

set_page_config()
config = open_st_credential()
authenticator = stauth.Authenticate(
    config['credentials'],
    config['cookie']['name'],
    config['cookie']['key'],
    config['cookie']['expiry_days'],
    config['pre-authorized'],
)

In the other page, I have to replicate this part, something like this:
config = open_st_credential()
authenticator = stauth.Authenticate(
config[‘credentials’],
config[‘cookie’][‘name’],
config[‘cookie’][‘key’],
config[‘cookie’][‘expiry_days’],
config[‘pre-authorized’],
key=“resetpassword”
)

with st.expander("Click to change password"):
    if st.session_state["authentication_status"]:
        try:
            if authenticator.reset_password(st.session_state["username"]):
                    st.success('Password modified')
        except Exception as e:
            st.error(e)             

but I have issues with multiple widgets key.
Could anyone help me?
Thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.