mkhorasani / Streamlit-Authenticator

A secure authentication module to manage user access in a Streamlit application.
Other
1.66k stars 258 forks source link

SyntaxError: unmatched '[' in v0.3.4 #210

Closed HSILA closed 1 month ago

HSILA commented 1 month ago

On the latest version (0.3.4), when I construct an authenticator object with Authenticate:

import streamlit_authenticator as stauth
import yaml
from yaml.loader import SafeLoader

with open('./users.yaml') as file:
    config = yaml.load(file, Loader=SafeLoader)

authenticator = stauth.Authenticate(
    config['credentials'],
    config['cookie']['name'],
    config['cookie']['key'],
    config['cookie']['expiry_days'])

I will get the following error in the streamlit UI:

SyntaxError: File "E:\project\venv\lib\site-packages\streamlit_authenticator\models\authentication_model.py", line 299 st.session_state['name'] = f'{result['given_name']} {result['family_name']}' ^ SyntaxError: f-string: unmatched '['
mkhorasani commented 1 month ago

Hey @HSILA, thank you for bringing this to my attention! I have quickly fixed it and made some minor other changes as well.