forked from vrlnarayana/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthenticate.py
More file actions
16 lines (15 loc) · 805 Bytes
/
Copy pathauthenticate.py
File metadata and controls
16 lines (15 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import readdata
userdf = readdata.read_user()
# authenticate with name,passcode not empty and passcode matching
def authenticate(yourname, yourpass):
if yourname: # display blocks below if yourname is not empty
if yourpass: # display blocks below if yourpass is not empty
if userdf[userdf.name == yourname].pswd.values == yourpass:
# if yourpass == 'MIT@123': #display blocks below if yourpass is not equal to hashed code
return 'authenticated'
else:
return "<div>Enter <span class='highlight blue'>matching name/passcode</span></div>"
else:
return "<div>Enter <span class='highlight red'>passcode</span></div>"
else:
return "<div>Enter <span class='highlight blue'>your name</span></div>"