JSONify
This commit is contained in:
parent
9db8138416
commit
f0b527eb39
13
main
13
main
|
@ -197,9 +197,12 @@ async def apiauthenticate():
|
||||||
userCookie = get_session(secretKey)
|
userCookie = get_session(secretKey)
|
||||||
user = get_user(userCookie["id"])
|
user = get_user(userCookie["id"])
|
||||||
conn = get_db_connection()
|
conn = get_db_connection()
|
||||||
secretkey = conn.execute("SELECT secret FROM userdata WHERE appId = ? AND creator = ? LIMIT 1", (str(appId),int(user["id"])))
|
secretkey = {
|
||||||
|
"key": str(conn.execute("SELECT secret FROM userdata WHERE appId = ? AND creator = ? LIMIT 1", (str(appId),int(user["id"]))))
|
||||||
|
}
|
||||||
|
|
||||||
if secretkey:
|
if secretkey:
|
||||||
return secretkey
|
return secretkey, 200
|
||||||
else:
|
else:
|
||||||
return {}, 400
|
return {}, 400
|
||||||
|
|
||||||
|
@ -219,8 +222,10 @@ async def apicreateauth():
|
||||||
(str(appId),int(user["id"]),str(secret)))
|
(str(appId),int(user["id"]),str(secret)))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
secretkey = {
|
||||||
return secret, 200
|
"key": secret
|
||||||
|
}
|
||||||
|
return secretkey, 200
|
||||||
|
|
||||||
@app.route("/api/deleteaccount", methods=("GET", "POST"))
|
@app.route("/api/deleteaccount", methods=("GET", "POST"))
|
||||||
async def apideleteaccount():
|
async def apideleteaccount():
|
||||||
|
|
Reference in New Issue