forked from IGYBB1991/itdworkshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthenticate.py
More file actions
31 lines (27 loc) · 1.09 KB
/
authenticate.py
File metadata and controls
31 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import streamlit as st
def class1_login():
with st.form("my_form"):
st.write("Code Exercises")
course_code = st.text_input("Enter your course code")
# Every form must have a submit button.
submitted = st.form_submit_button("Submit")
if submitted:
if course_code == st.secrets['class1']:
st.success("Authenticated Successfully!")
return True
else:
st.error("Please enter a valid course code")
return False
def class0_login():
with st.form("my_form_0"):
st.write("Workshop 0: Introduction to Python and Basics of Programming")
course_code = st.text_input("Enter your course code")
# Every form must have a submit button.
submitted = st.form_submit_button("Submit")
if submitted:
if course_code == st.secrets['class0']:
st.success("Authenticated Successfully!")
return True
else:
st.error("Please enter a valid course code")
return False