diff --git a/account/__pycache__/userid.cpython-312.pyc b/account/__pycache__/userid.cpython-312.pyc index 742c442..8cfef2c 100644 Binary files a/account/__pycache__/userid.cpython-312.pyc and b/account/__pycache__/userid.cpython-312.pyc differ diff --git a/account/__pycache__/username.cpython-312.pyc b/account/__pycache__/username.cpython-312.pyc index 7c2d9e7..eb1a26f 100644 Binary files a/account/__pycache__/username.cpython-312.pyc and b/account/__pycache__/username.cpython-312.pyc differ diff --git a/account/main.py b/account/main.py index 6b46111..9b71c07 100644 --- a/account/main.py +++ b/account/main.py @@ -1,3 +1,4 @@ +import re import time import streamlit as st from account.loader import account_database_loader @@ -24,6 +25,13 @@ def update_username(user_id, email, new_username): sys_log("Changed Username", "Username: " + username + " User ID: " + str(user_id) + " Email: " + email + " Password: " + password) conn.commit() +def verify_email(email): + regex = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b' + if(re.fullmatch(regex, email)): + return False + else: + return True + def check_existing_email(email): cursor.execute("SELECT * FROM users WHERE email=?", (email,)) return cursor.fetchone() is not None @@ -56,6 +64,8 @@ def check_existing_username(username): if email and username and password: if check_existing_email(email): st.error('This email is already registered. Please use a different email.') + elif verify_email(email): + st.error('This email is invalid, please check again.') elif check_existing_username(username): st.error('This user name already in use. Please use another username.') else: diff --git a/database/users-account.db b/database/users-account.db index 03cf2ff..d639e6f 100644 Binary files a/database/users-account.db and b/database/users-account.db differ