feat: Add db table for sites
All checks were successful
Build Docker / Build Main Image (push) Successful in 18s
Build Docker / Build SLDs Image (push) Successful in 18s

This commit is contained in:
Nathan Woodburn 2023-11-08 19:18:16 +11:00
parent 083796b035
commit da417c4b63
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 13 additions and 1 deletions

View File

@ -33,6 +33,10 @@ def generate_cookie():
# Create a new user
def create_user(email, domain, password):
if len(email) < 4 or len(domain) < 4 or len(password) < 4:
return {'success': False, 'message': 'Invalid email, domain, or password'}
# Hash password
hashed_password = hash_password(password)
# Create user

10
db.py
View File

@ -27,7 +27,15 @@ def check_tables():
token VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
)
""")
""")
cursor.execute("""
CREATE TABLE IF NOT EXISTS site (
id INT(11) NOT NULL AUTO_INCREMENT,
domain VARCHAR(255) NOT NULL,
data VARCHAR(2048) NOT NULL,
PRIMARY KEY (id)
)
""")
cursor.close()
connection.close()
print("Checked tables")