Fixed deleting

This commit is contained in:
Tracker-Friendly 2024-04-02 18:25:49 +01:00
parent 0034c12816
commit 9d9c88c6e6
1 changed files with 6 additions and 9 deletions

15
main
View File

@ -373,16 +373,13 @@ async def apideleteauth():
conn = get_db_connection()
try:
conn.execute("DELETE FROM oauth WHERE appId = ? AND creator = ?", (str(appId), str(user["id"])))
conn.execute("DELETE FROM oauth WHERE appId = ? AND creator = ?", (str(appId), int(user["id"])))
conn.commit()
conn.close()
except:
return 400
return {}, 400
else:
try:
conn.execute("DELETE FROM oauth WHERE appId = ? AND creator = ?", (str(appId), str(user["id"])))
except:
pass
else:
return 200
return {}, 200
@app.route("/api/newauth", methods=("GET", "POST"))
async def apicreateauth():
@ -406,7 +403,7 @@ async def apicreateauth():
except:
print("New Oauth added with ID", appId)
else:
return 401
return {}, 401
userCookie = get_session(secretKey)
user = get_user(userCookie["id"])