Suddenly getting this weird user authentication error

I am using the latest versions of Python and Streamlit. I am getting this error when running my app:

File “/Users/------/Developer/------/frontend/Home.py”, line 40, in
if not check_perm() == “not_logged_in”:
^^^^^^^^^^^^File “/Users/------/Developer/--------/frontend/Home.py”, line 25, in check_perm
if st.user.is_logged_in:
^^^^^^^^^^^^^^^^^^^^File “/Users/----/Developer/------/.venv/lib/python3.12/site-packages/streamlit/user_info.py”, line 495, in getattr
raise AttributeError(f’st.experimental_user has no attribute “{key}”.')

This was not happening earlier, and I think I may have changed something. I switched my deployment to a different domain along with the google authentication redirect, so that is likely the cause. However I can’t figure out how to fix this, not sure why it’s using experimental_user when I’m using st.user

Any help would be appreciated

I have the same exact issue right now and it makes me CRAZY.

Did you make any progress on this? I am having this issue too.

I faced similar issue before but finally figure out the solutions.

You need to configure the secrets.toml file at every instance where the application is run.

From the documentation st.user - Streamlit Docs

I solved this issue by renaming my docker compose secret to include a .toml suffix. Previously it had no suffix, but streamlit didn’t seem to accept that as a valid secrets file

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