diff --git a/dist/package-shared/actions/users/social/google-auth.js b/dist/package-shared/actions/users/social/google-auth.js index b03ed35..ca57dcf 100644 --- a/dist/package-shared/actions/users/social/google-auth.js +++ b/dist/package-shared/actions/users/social/google-auth.js @@ -24,8 +24,10 @@ const write_auth_files_1 = require("../../../functions/backend/auth/write-auth-f function googleAuth(_a) { return __awaiter(this, arguments, void 0, function* ({ key, token, database, response, encryptionKey, encryptionSalt, additionalFields, additionalData, apiUserID, debug, }) { var _b; - const grabedHostNames = (0, grab_host_names_1.default)(); - const { host, port, scheme } = grabedHostNames; + const grabedHostNames = (0, grab_host_names_1.default)({ + userId: apiUserID || process.env.DSQL_API_USER_ID, + }); + const { host, port, scheme, user_id } = grabedHostNames; const finalEncryptionKey = encryptionKey || process.env.DSQL_ENCRYPTION_PASSWORD; const finalEncryptionSalt = encryptionSalt || process.env.DSQL_ENCRYPTION_SALT; if (!(finalEncryptionKey === null || finalEncryptionKey === void 0 ? void 0 : finalEncryptionKey.match(/.{8,}/))) { @@ -84,12 +86,6 @@ function googleAuth(_a) { }); } 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 = yield new Promise((resolve, reject) => { const reqPayload = JSON.stringify({ token, @@ -144,7 +140,7 @@ function googleAuth(_a) { }); const cookieNames = (0, get_auth_cookie_names_1.default)({ database, - userId: apiUserID || process.env.DSQL_API_USER_ID, + userId: user_id, }); if (httpResponse.csrf) { (0, write_auth_files_1.writeAuthFile)(httpResponse.csrf, JSON.stringify(httpResponse.payload)); diff --git a/package-shared/actions/users/social/google-auth.ts b/package-shared/actions/users/social/google-auth.ts index a2d9472..05d7979 100644 --- a/package-shared/actions/users/social/google-auth.ts +++ b/package-shared/actions/users/social/google-auth.ts @@ -34,8 +34,10 @@ export default async function googleAuth({ apiUserID, debug, }: Param): Promise { - 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) { diff --git a/package.json b/package.json index 864fd5c..ba3ee30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "3.9.8", + "version": "3.9.9", "description": "Cloud-based SQL data management tool", "main": "dist/index.js", "bin": {