Spaces:
Sleeping
Sleeping
raymondEDS
commited on
Commit
·
2fd2e4b
1
Parent(s):
05152ad
fixing
Browse files- src/streamlit_app.py +6 -3
src/streamlit_app.py
CHANGED
|
@@ -29,23 +29,26 @@ if 'users_config' not in st.session_state:
|
|
| 29 |
|
| 30 |
def create_default_users():
|
| 31 |
"""Create default users configuration"""
|
|
|
|
|
|
|
|
|
|
| 32 |
default_users = {
|
| 33 |
'credentials': {
|
| 34 |
'usernames': {
|
| 35 |
'admin': {
|
| 36 |
'email': 'admin@example.com',
|
| 37 |
'name': 'Administrator',
|
| 38 |
-
'password':
|
| 39 |
},
|
| 40 |
'teacher': {
|
| 41 |
'email': 'teacher@example.com',
|
| 42 |
'name': 'Teacher',
|
| 43 |
-
'password':
|
| 44 |
},
|
| 45 |
'student': {
|
| 46 |
'email': 'student@example.com',
|
| 47 |
'name': 'Student',
|
| 48 |
-
'password':
|
| 49 |
}
|
| 50 |
}
|
| 51 |
}
|
|
|
|
| 29 |
|
| 30 |
def create_default_users():
|
| 31 |
"""Create default users configuration"""
|
| 32 |
+
# Hash passwords using the correct syntax
|
| 33 |
+
hashed_passwords = stauth.Hasher(['admin123', 'teacher123', 'student123']).generate()
|
| 34 |
+
|
| 35 |
default_users = {
|
| 36 |
'credentials': {
|
| 37 |
'usernames': {
|
| 38 |
'admin': {
|
| 39 |
'email': 'admin@example.com',
|
| 40 |
'name': 'Administrator',
|
| 41 |
+
'password': hashed_passwords[0]
|
| 42 |
},
|
| 43 |
'teacher': {
|
| 44 |
'email': 'teacher@example.com',
|
| 45 |
'name': 'Teacher',
|
| 46 |
+
'password': hashed_passwords[1]
|
| 47 |
},
|
| 48 |
'student': {
|
| 49 |
'email': 'student@example.com',
|
| 50 |
'name': 'Student',
|
| 51 |
+
'password': hashed_passwords[2]
|
| 52 |
}
|
| 53 |
}
|
| 54 |
}
|