Merge branch 'main' of hectabit.org:arzumify/hectabit-oauth2
This commit is contained in:
commit
550afa6086
15
main
15
main
|
@ -373,16 +373,13 @@ async def apideleteauth():
|
||||||
conn = get_db_connection()
|
conn = get_db_connection()
|
||||||
|
|
||||||
try:
|
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:
|
except:
|
||||||
return 400
|
return {}, 400
|
||||||
else:
|
else:
|
||||||
try:
|
return {}, 200
|
||||||
conn.execute("DELETE FROM oauth WHERE appId = ? AND creator = ?", (str(appId), str(user["id"])))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
return 200
|
|
||||||
|
|
||||||
@app.route("/api/newauth", methods=("GET", "POST"))
|
@app.route("/api/newauth", methods=("GET", "POST"))
|
||||||
async def apicreateauth():
|
async def apicreateauth():
|
||||||
|
@ -406,7 +403,7 @@ async def apicreateauth():
|
||||||
except:
|
except:
|
||||||
print("New Oauth added with ID", appId)
|
print("New Oauth added with ID", appId)
|
||||||
else:
|
else:
|
||||||
return 401
|
return {}, 401
|
||||||
|
|
||||||
userCookie = get_session(secretKey)
|
userCookie = get_session(secretKey)
|
||||||
user = get_user(userCookie["id"])
|
user = get_user(userCookie["id"])
|
||||||
|
|
Reference in New Issue