From 642a6aad36a684a7d00f56c1810e9c14c5b26215 Mon Sep 17 00:00:00 2001 From: arzumify Date: Thu, 28 Mar 2024 18:03:49 +0000 Subject: [PATCH] Made clientid and appid consistant --- main | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main b/main index f4bb841..685c4d2 100644 --- a/main +++ b/main @@ -220,8 +220,8 @@ async def apiauthenticate(): conn = get_db_connection() secretkey = str(secrets.token_hex(512)) - clientidcheck = str(conn.execute("SELECT appId FROM oauth WHERE appId = ?", (str(appId),)).fetchone()) - if not str(clientidcheck) == str(appId): + appidcheck = str(conn.execute("SELECT appId FROM oauth WHERE appId = ?", (str(appId),)).fetchone()) + if not str(appidcheck) == str(appId): return {}, 401 conn.execute("INSERT INTO logins (appId, secret, code, nextcode, creator, openid) VALUES (?, ?, ?, ?, ?, ?)", @@ -251,8 +251,8 @@ async def apitokenexchange(): "id_token": str(conn.execute("SELECT openid FROM logins WHERE appId = ? AND code = ?", (str(appId), str(code))).fetchone()) } - clientidcheck = str(conn.execute("SELECT appId FROM oauth WHERE appId = ?", (str(appId),)).fetchone()) - if not str(clientidcheck) == str(appId): + appidcheck = str(conn.execute("SELECT appId FROM oauth WHERE appId = ?", (str(appId),)).fetchone()) + if not str(appidcheck) == str(appId): return {}, 401 secretcheck = str(conn.execute("SELECT secret FROM oauth WHERE appId = ?", (str(appId),)).fetchone()) @@ -280,7 +280,7 @@ async def apicreateauth(): secret = str(secrets.token_hex(512)) continue - if clientId == str(conn.execute("SELECT secret FROM oauth WHERE clientId = ?", (str(clientId),)).fetchone()): + if appId == str(conn.execute("SELECT secret FROM oauth WHERE appId = ?", (str(appId),)).fetchone()): return 401 userCookie = get_session(secretKey)