-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgetpassPage.py
More file actions
34 lines (28 loc) · 1.1 KB
/
Copy pathforgetpassPage.py
File metadata and controls
34 lines (28 loc) · 1.1 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
32
33
34
import streamlit as st
import EmailValidation as Emv
import SendVerification as SV
import PasswordHash as Phash
import DataBase as db
from coursegeneration import GenerateCourse
GD = GenerateCourse()
EmInstance = Emv.EmailValidation()
SVinstance = SV.SendEmail()
PhashInstance = Phash.PasswordHashing()
dbInstance = db.Database()
def forgetPass():
user_email = st.text_input("Enter your email address")
if st.button("Submit ✔️"):
if not EmInstance.isDublicated(user_email):
GD.show_dialog("Please enter a valid and registered email address")
else:
if SVinstance.is_Outlook(user_email):
st.session_state.code = SVinstance.send_To_Outlook(user_email)
else:
st.session_state.code = SVinstance.send_To_Gmail(user_email)
st.session_state.email = user_email
st.success(f"code sent to {user_email} check it")
st.session_state.page = "checkcode"
st.rerun()
if st.button('Login 🔑'):
st.session_state.page = "login"
st.rerun()