Skip to content

Commit fed94c0

Browse files
committed
FIX: Correctly save pre-authorized emails
1 parent ebc7fb5 commit fed94c0

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="streamlit-authenticator",
8-
version="0.4.2",
8+
version="0.4.2-alpha",
99
author="Mohammad Khorasani",
1010
author_email="khorasani.mohammad@gmail.com",
1111
description="A secure authentication module to manage user access in a Streamlit application.",

streamlit_authenticator/models/authentication_model.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,22 @@
1414

1515
import streamlit as st
1616

17-
from ..models.cloud import CloudModel
18-
from ..models.oauth2 import GoogleModel
19-
from ..models.oauth2 import MicrosoftModel
2017
from .. import params
21-
from ..utilities import (Encryptor,
22-
Hasher,
23-
Helpers,
24-
CloudError,
25-
CredentialsError,
26-
ForgotError,
27-
LoginError,
28-
RegisterError,
29-
ResetError,
30-
UpdateError,
31-
Validator)
18+
from ..models.cloud import CloudModel
19+
from ..models.oauth2 import GoogleModel, MicrosoftModel
20+
from ..utilities import (
21+
CloudError,
22+
CredentialsError,
23+
Encryptor,
24+
ForgotError,
25+
Hasher,
26+
Helpers,
27+
LoginError,
28+
RegisterError,
29+
ResetError,
30+
UpdateError,
31+
Validator,
32+
)
3233

3334

3435
class AuthenticationModel:
@@ -568,7 +569,7 @@ def register_user(self, new_first_name: str, new_last_name: str, new_email: str,
568569
new_password, new_email, password_hint, roles)
569570
pre_authorized.remove(new_email)
570571
if self.path:
571-
Helpers.update_config_file(self.path, 'pre-authorized', pre_authorized)
572+
Helpers.update_config_file(self.path, 'pre-authorized', {"emails": pre_authorized})
572573
if callback:
573574
callback({'widget': 'Register user', 'new_name': new_first_name,
574575
'new_last_name': new_last_name, 'new_email': new_email,

0 commit comments

Comments
 (0)