Fixed weird-ahh conn connection and oauth table
This commit is contained in:
parent
313d81742f
commit
f3ae325532
4
main
4
main
|
@ -224,8 +224,8 @@ async def apiauthenticate():
|
|||
if not str(clientidcheck) == str(appId):
|
||||
return {}, 401
|
||||
|
||||
conn.execute("INSERT INTO logins (appId, authed, secret, code, nextcode, creator, openid) VALUES (?, ?, ?, ?, ?, ?, ?)",
|
||||
(str(appId), int(int(time.time()) + 3600), int(0), str(secretkey), str(secrets.token_hex(512)), str(secrets.token_hex(512)), int(user["id"]), str(secrets.token_hex(512))))
|
||||
conn.execute("INSERT INTO logins (appId, secret, code, nextcode, creator, openid) VALUES (?, ?, ?, ?, ?, ?)",
|
||||
(str(appId), str(secretkey), str(secrets.token_hex(512)), str(secrets.token_hex(512)), int(user["id"]), str(secrets.token_hex(512))))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
|
|
|
@ -25,10 +25,15 @@ CREATE TABLE sessions (
|
|||
|
||||
CREATE TABLE logins (
|
||||
appId TEXT NOT NULL,
|
||||
authed INTEGER NOT NULL,
|
||||
secret TEXT NOT NULL,
|
||||
code TEXT NOT NULL,
|
||||
nextcode TEXT NOT NULL,
|
||||
creator INTEGER NOT NULL,
|
||||
openid TEXT NOT NULL
|
||||
)
|
||||
|
||||
CREATE TABLE oauth (
|
||||
appId TEXT NOT NULL,
|
||||
secret TEXT NOT NULL,
|
||||
creator INTEGER NOT NULL
|
||||
)
|
||||
|
|
Reference in New Issue