Spaces:
Runtime error
Runtime error
CaesarCloudSync commited on
Commit ·
d75d1ed
1
Parent(s): cb8fcca
Make Signup auth json Model mor general
Browse files- __pycache__/main.cpython-310.pyc +0 -0
- main.py +2 -4
__pycache__/main.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/main.cpython-310.pyc and b/__pycache__/main.cpython-310.pyc differ
|
|
|
main.py
CHANGED
|
@@ -967,8 +967,6 @@ async def signup(data: JSONStructure = None):
|
|
| 967 |
hashed = hashlib.sha256(data["password"].encode('utf-8')).hexdigest()
|
| 968 |
signupdata["email"] = data["email"]
|
| 969 |
signupdata["password"] = hashed
|
| 970 |
-
|
| 971 |
-
print(signupdata["email"])
|
| 972 |
email_exists = importcsv.db.users.find_one({"email": signupdata["email"]})
|
| 973 |
email_exists_student = importcsv.db.studentsubscriptions.find_one({"email": signupdata["email"]}) # Checks if student account exists
|
| 974 |
if email_exists or email_exists_student:
|
|
@@ -978,8 +976,8 @@ async def signup(data: JSONStructure = None):
|
|
| 978 |
#if datetime.now() < "2022-05-19T21:37:00.057084":
|
| 979 |
# signupdata.update({"betatest":"true"})
|
| 980 |
importcsv.db.users.insert_one(signupdata)
|
| 981 |
-
access_token = secure_encode({
|
| 982 |
-
callback = {"status": "success","
|
| 983 |
return callback
|
| 984 |
except Exception as ex:
|
| 985 |
error_detected = {"error": "error occured","errortype":type(ex), "error": str(ex)}
|
|
|
|
| 967 |
hashed = hashlib.sha256(data["password"].encode('utf-8')).hexdigest()
|
| 968 |
signupdata["email"] = data["email"]
|
| 969 |
signupdata["password"] = hashed
|
|
|
|
|
|
|
| 970 |
email_exists = importcsv.db.users.find_one({"email": signupdata["email"]})
|
| 971 |
email_exists_student = importcsv.db.studentsubscriptions.find_one({"email": signupdata["email"]}) # Checks if student account exists
|
| 972 |
if email_exists or email_exists_student:
|
|
|
|
| 976 |
#if datetime.now() < "2022-05-19T21:37:00.057084":
|
| 977 |
# signupdata.update({"betatest":"true"})
|
| 978 |
importcsv.db.users.insert_one(signupdata)
|
| 979 |
+
access_token = secure_encode({"email":signupdata["email"]})#create_access_token(identity=signupdata["email"])
|
| 980 |
+
callback = {"status": "success","access_token":access_token}
|
| 981 |
return callback
|
| 982 |
except Exception as ex:
|
| 983 |
error_detected = {"error": "error occured","errortype":type(ex), "error": str(ex)}
|