Spaces:
Runtime error
Runtime error
IsaacKerson
commited on
Commit
•
95a21ea
1
Parent(s):
c72c7ac
write out fuctions for test
Browse files- authenticator.py +2 -2
- pages/login.py +2 -1
authenticator.py
CHANGED
@@ -108,7 +108,7 @@ class Authenticate:
|
|
108 |
c = self.get_cursor()
|
109 |
for item in c.execute(query, self.dbtable):
|
110 |
usernames.append(item[0])
|
111 |
-
if self.
|
112 |
return True
|
113 |
else:
|
114 |
return False
|
@@ -158,7 +158,7 @@ class Authenticate:
|
|
158 |
boolean
|
159 |
The validation state for the input password by comparing it to the hashed password on disk.
|
160 |
"""
|
161 |
-
return bcrypt.checkpw(self.password.encode(), self.get_hashed_password()
|
162 |
|
163 |
def login(self, form_name, location='main'):
|
164 |
"""Create a new instance of "authenticate".
|
|
|
108 |
c = self.get_cursor()
|
109 |
for item in c.execute(query, self.dbtable):
|
110 |
usernames.append(item[0])
|
111 |
+
if self.username in usernames:
|
112 |
return True
|
113 |
else:
|
114 |
return False
|
|
|
158 |
boolean
|
159 |
The validation state for the input password by comparing it to the hashed password on disk.
|
160 |
"""
|
161 |
+
return bcrypt.checkpw(self.password.encode(), self.get_hashed_password())
|
162 |
|
163 |
def login(self, form_name, location='main'):
|
164 |
"""Create a new instance of "authenticate".
|
pages/login.py
CHANGED
@@ -32,7 +32,8 @@ def app():
|
|
32 |
st.write(auth.get_path())
|
33 |
st.write(auth.get_connection())
|
34 |
st.write(auth.check_connection())
|
35 |
-
|
|
|
36 |
auth.login('Login', 'main')
|
37 |
|
38 |
if st.session_state['authentication_status']:
|
|
|
32 |
st.write(auth.get_path())
|
33 |
st.write(auth.get_connection())
|
34 |
st.write(auth.check_connection())
|
35 |
+
st.write(auth.check_username())
|
36 |
+
st.write(auth.get_hashed_password())
|
37 |
auth.login('Login', 'main')
|
38 |
|
39 |
if st.session_state['authentication_status']:
|