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

login() example needed with latest release 0.3.1 #135

Closed OldishCoder closed 3 months ago

OldishCoder commented 4 months ago

Hello, I'm trying to use the latest version of authenticator, but unable to figure out the new login argument syntax from the description in the Readme: authenticator.login()

Authenticate.login Parameters:

location: str, {'main', 'sidebar'}, default 'main'
    Specifies the location of the login widget.
max_concurrent_users: int, default None
    Limits the number of concurrent users. If not specified there will be no limit to the number of users.
fields: dict, default {'Form name':'Login', 'Username':'Username', 'Password':'Password', 'Login':'Login'}
    Customizes the text of headers, buttons and other fields.

Could you please give a working example of login() with all of the possible parameters?

fsmosca commented 3 months ago
authenticator.login(
    location='main',  # 'main', 'sidebar'
    max_concurrent_users=100,  # None is unlimited
    fields={
        'Form name': 'Welcome aboard to Andromeda Login form',
        'Username': 'Your username',
        'Password': 'Your password',
        'Login': 'Let me in'
    }
)

image