mgbam commited on
Commit
9ea931b
·
verified ·
1 Parent(s): bdc0b82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -3,18 +3,24 @@ import transformers
3
  import altair as alt
4
  import pandas as pd
5
  import streamlit_authenticator as stauth
 
6
  from difflib import SequenceMatcher
7
 
8
  # ------------------------------
9
  # User Authentication Setup
10
  # ------------------------------
11
- # Sample configuration for authentication
 
 
 
 
 
12
  config = {
13
  'credentials': {
14
  'usernames': {
15
  'demo_user': {
16
  'name': 'Demo User',
17
- 'password': stauth.Hasher(['password123']).generate()[0] # hashed password
18
  }
19
  }
20
  },
 
3
  import altair as alt
4
  import pandas as pd
5
  import streamlit_authenticator as stauth
6
+ import bcrypt
7
  from difflib import SequenceMatcher
8
 
9
  # ------------------------------
10
  # User Authentication Setup
11
  # ------------------------------
12
+
13
+ # Manually hash the password using bcrypt
14
+ plain_password = "password123"
15
+ hashed_password = bcrypt.hashpw(plain_password.encode('utf-8'), bcrypt.gensalt()).decode('utf-8')
16
+
17
+ # Configuration for authentication
18
  config = {
19
  'credentials': {
20
  'usernames': {
21
  'demo_user': {
22
  'name': 'Demo User',
23
+ 'password': hashed_password # use the manually hashed password
24
  }
25
  }
26
  },