Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="streamlit-authenticator",
version="0.4.2",
version="0.4.2-alpha",
author="Mohammad Khorasani",
author_email="khorasani.mohammad@gmail.com",
description="A secure authentication module to manage user access in a Streamlit application.",
Expand Down
31 changes: 16 additions & 15 deletions streamlit_authenticator/models/authentication_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@

import streamlit as st

from ..models.cloud import CloudModel
from ..models.oauth2 import GoogleModel
from ..models.oauth2 import MicrosoftModel
from .. import params
from ..utilities import (Encryptor,
Hasher,
Helpers,
CloudError,
CredentialsError,
ForgotError,
LoginError,
RegisterError,
ResetError,
UpdateError,
Validator)
from ..models.cloud import CloudModel
from ..models.oauth2 import GoogleModel, MicrosoftModel
from ..utilities import (
CloudError,
CredentialsError,
Encryptor,
ForgotError,
Hasher,
Helpers,
LoginError,
RegisterError,
ResetError,
UpdateError,
Validator,
)


class AuthenticationModel:
Expand Down Expand Up @@ -568,7 +569,7 @@ def register_user(self, new_first_name: str, new_last_name: str, new_email: str,
new_password, new_email, password_hint, roles)
pre_authorized.remove(new_email)
if self.path:
Helpers.update_config_file(self.path, 'pre-authorized', pre_authorized)
Helpers.update_config_file(self.path, 'pre-authorized', {"emails": pre_authorized})
if callback:
callback({'widget': 'Register user', 'new_name': new_first_name,
'new_last_name': new_last_name, 'new_email': new_email,
Expand Down
6 changes: 3 additions & 3 deletions streamlit_authenticator/models/cookie_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def __init__(
"""
if path:
config = Helpers.read_config_file(path)
self.cookie_name = config['cookie']['name']
self.cookie_key = config['cookie']['key']
self.cookie_expiry_days = config['cookie']['expiry_days']
self.cookie_name = cookie_name or config['cookie']['name']
self.cookie_key = cookie_key or config['cookie']['key']
self.cookie_expiry_days = cookie_expiry_days if cookie_expiry_days is not None else config['cookie']['expiry_days']
else:
self.cookie_name = cookie_name
self.cookie_key = cookie_key
Expand Down