Skip to content

Commit b42c245

Browse files
authored
Merge pull request #246 from Ledgebrook-insurtech/main
bugfix: using logout after experimental_login with google errors out.
2 parents dcd1857 + 230639f commit b42c245

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

streamlit_authenticator/models/authentication_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ def logout(self, callback: Optional[Callable]=None):
418418
callback: callable, optional
419419
Callback function that will be invoked on button press.
420420
"""
421-
self.credentials['usernames'][st.session_state['username']]['logged_in'] = False
421+
if st.session_state.get('username') in self.credentials['usernames']:
422+
self.credentials['usernames'][st.session_state['username']]['logged_in'] = False
422423
st.session_state['logout'] = True
423424
st.session_state['name'] = None
424425
st.session_state['username'] = None

0 commit comments

Comments
 (0)