38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
from functions import *
|
|
|
|
import requests
|
|
|
|
|
|
user = None
|
|
|
|
# Does the user have an active account?
|
|
active_account = input("Do you have an account? (y/n): ")
|
|
if active_account == "y":
|
|
email = input("Enter your email: ")
|
|
password = input("Enter your password: ")
|
|
|
|
is_authenticated = login(email, password)
|
|
|
|
if is_authenticated is not False:
|
|
user = is_authenticated
|
|
else:
|
|
print("Sign in failed. Check your email or password")
|
|
else:
|
|
account = input("Do you want to create an account? (y/n): ")
|
|
if account.lower() == "y":
|
|
name = input("Enter your name: ")
|
|
email = input("Enter your email: ")
|
|
password = input("Enter your password: ")
|
|
|
|
is_authenticated = create_account(name, email, password)
|
|
|
|
if is_authenticated is not False:
|
|
user = is_authenticated
|
|
else:
|
|
print("Something went wrong.. Please try again later")
|
|
else:
|
|
print("Bye bye..")
|
|
|
|
while user is not None:
|
|
print(f"Welcome {user['name']}!")
|
|
break |