Wait in the right place
This commit is contained in:
parent
4c6f0123a0
commit
5c843c18eb
2
main
2
main
|
@ -75,6 +75,7 @@ def check_username_taken(username):
|
||||||
|
|
||||||
async def oauth2_token_refresh(openid, appId):
|
async def oauth2_token_refresh(openid, appId):
|
||||||
while True:
|
while True:
|
||||||
|
await asyncio.sleep(3600)
|
||||||
conn = get_db_connection()
|
conn = get_db_connection()
|
||||||
|
|
||||||
# Fetch required data in a single query
|
# Fetch required data in a single query
|
||||||
|
@ -102,7 +103,6 @@ async def oauth2_token_refresh(openid, appId):
|
||||||
conn.execute("UPDATE logins SET code = ?, nextcode = ?, secret = ?, nextsecret = ?, openid = ?, nextopenid = ? WHERE appId = ? AND openid = ?", (nextcode, str(secrets.token_hex(512)), nextsecret, str(secrets.token_hex(512)), nextopenid, str(jwt_token), str(appId), str(openid)))
|
conn.execute("UPDATE logins SET code = ?, nextcode = ?, secret = ?, nextsecret = ?, openid = ?, nextopenid = ? WHERE appId = ? AND openid = ?", (nextcode, str(secrets.token_hex(512)), nextsecret, str(secrets.token_hex(512)), nextopenid, str(jwt_token), str(appId), str(openid)))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
await asyncio.sleep(3600)
|
|
||||||
else:
|
else:
|
||||||
conn.close()
|
conn.close()
|
||||||
return
|
return
|
||||||
|
|
Reference in New Issue