mkhorasani / Streamlit-Authenticator

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

Trying to delete a cookie that does not exist in the self.cookies dictionary #170

Closed ArenT-B closed 3 weeks ago

ArenT-B commented 3 weeks ago

Code is trying to delete a cookie that does not exist in the self.cookies dictionary.

This happens during the logout process when the Streamlit Authenticator tries to clear cookies.

KeyError: 'some_cookie_name'
Traceback:
File "/home/ubuntu/caslens_fdi_v0/caslens_fdi_v0/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in exec(code, module.__dict__)
File "/home/ubuntu/caslens_fdi_v0/caslens_fdi_v0.py", line 347, in <module> authenticator.logout('Logout', 'main', key='unique_key_1')
File "/home/ubuntu/caslens_fdi_v0/caslens_fdi_v0/lib/python3.12/site-packages/streamlit_authenticator/authenticate.py", line 288, in logout self._implement_logout()
File "/home/ubuntu/caslens_fdi_v0/caslens_fdi_v0/lib/python3.12/site-packages/streamlit_authenticator/authenticate.py", line 264, in _implement_logout self.cookie_manager.delete(self.cookie_name)
File "/home/ubuntu/caslens_fdi_v0/caslens_fdi_v0/lib/python3.12/site-packages/extra_streamlit_components/CookieManager/__init__.py", line 138, in delete del self.cookies[cookie]
mkhorasani commented 3 weeks ago

Hi @ArenT-B, please update to v0.3.2 of Streamlit-Authenticator.