Google Login Bugfix

This commit is contained in:
Benjamin Toby
2025-02-05 19:45:02 +01:00
parent 06de31dcb2
commit 64ee344ba1
3 changed files with 11 additions and 19 deletions
@@ -34,8 +34,10 @@ export default async function googleAuth({
apiUserID,
debug,
}: Param): Promise<APILoginFunctionReturn> {
const grabedHostNames = grabHostNames();
const { host, port, scheme } = grabedHostNames;
const grabedHostNames = grabHostNames({
userId: apiUserID || process.env.DSQL_API_USER_ID,
});
const { host, port, scheme, user_id } = grabedHostNames;
const finalEncryptionKey =
encryptionKey || process.env.DSQL_ENCRYPTION_PASSWORD;
@@ -107,12 +109,6 @@ export default async function googleAuth({
debug,
});
} else {
/**
* Make https request
*
* @description make a request to datasquirel.com
* @type {{ success: boolean, user: import("../../../types").DATASQUIREL_LoggedInUser | null, msg?: string, dsqlUserId?: number } | null } - Https response object
*/
httpResponse = await new Promise((resolve, reject) => {
const reqPayload = JSON.stringify({
token,
@@ -179,7 +175,7 @@ export default async function googleAuth({
const cookieNames = getAuthCookieNames({
database,
userId: apiUserID || process.env.DSQL_API_USER_ID,
userId: user_id,
});
if (httpResponse.csrf) {