Google Login Bugfix
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user