Skip to content

Commit ebc7fb5

Browse files
authored
FEAT: Allow to overwrite cookie config with init values
Allow to overwrite cookie config with init values. Then, init values have preference over config values and also allows having authenticated config from config file and cookie config values from init.
1 parent de75639 commit ebc7fb5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

streamlit_authenticator/models/cookie_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def __init__(
4848
"""
4949
if path:
5050
config = Helpers.read_config_file(path)
51-
self.cookie_name = config['cookie']['name']
52-
self.cookie_key = config['cookie']['key']
53-
self.cookie_expiry_days = config['cookie']['expiry_days']
51+
self.cookie_name = cookie_name or config['cookie']['name']
52+
self.cookie_key = cookie_key or config['cookie']['key']
53+
self.cookie_expiry_days = cookie_expiry_days if cookie_expiry_days is not None else config['cookie']['expiry_days']
5454
else:
5555
self.cookie_name = cookie_name
5656
self.cookie_key = cookie_key

0 commit comments

Comments
 (0)