I am dumb
This commit is contained in:
parent
dc4db6ff2d
commit
bd74f89eed
BIN
database.db
BIN
database.db
Binary file not shown.
4
main
4
main
|
@ -197,7 +197,7 @@ 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", (appId,user))
|
secretkey = conn.execute("SELECT secret FROM userdata WHERE appId = ? AND creator = ? LIMIT 1", (str(appId),int(user)))
|
||||||
if secretkey:
|
if secretkey:
|
||||||
return secretkey
|
return secretkey
|
||||||
else:
|
else:
|
||||||
|
@ -216,7 +216,7 @@ async def apicreateauth():
|
||||||
|
|
||||||
conn = get_db_connection()
|
conn = get_db_connection()
|
||||||
conn.execute("INSERT INTO userdata (appId, creator, secret) VALUES (?, ?, ?)",
|
conn.execute("INSERT INTO userdata (appId, creator, secret) VALUES (?, ?, ?)",
|
||||||
(appId,user,secret))
|
(str(appId),int(user),str(secret)))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ CREATE TABLE users (
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE userdata (
|
CREATE TABLE userdata (
|
||||||
creator TEXT NOT NULL,
|
creator INTEGER NOT NULL,
|
||||||
appId TEXT NOT NULL,
|
appId TEXT NOT NULL,
|
||||||
secret TEXT NOT NULL
|
secret TEXT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
Reference in New Issue