Updates
This commit is contained in:
Vendored
+2
-13
@@ -1,11 +1,4 @@
|
||||
export = googleAuth;
|
||||
/**
|
||||
* @typedef {object | null} FunctionReturn
|
||||
* @property {boolean} success - Did the function run successfully?
|
||||
* @property {import("../../types/user.td").DATASQUIREL_LoggedInUser | null} user - Returned User
|
||||
* @property {number} [dsqlUserId] - Dsql User Id
|
||||
* @property {string} [msg] - Response message
|
||||
*/
|
||||
/**
|
||||
* SERVER FUNCTION: Login with google Function
|
||||
* ==============================================================================
|
||||
@@ -23,7 +16,7 @@ export = googleAuth;
|
||||
* @param {string | number} [params.apiUserID] - API user ID
|
||||
* @param {boolean} [params.useLocal] - Whether to use a remote database instead of API
|
||||
*
|
||||
* @returns { Promise<FunctionReturn> }
|
||||
* @returns { Promise<import("../../package-shared/types").APILoginFunctionReturn> }
|
||||
*/
|
||||
declare function googleAuth({ key, token, database, response, encryptionKey, encryptionSalt, additionalFields, apiUserID, useLocal, }: {
|
||||
key?: string;
|
||||
@@ -35,9 +28,5 @@ declare function googleAuth({ key, token, database, response, encryptionKey, enc
|
||||
additionalFields?: string[];
|
||||
apiUserID?: string | number;
|
||||
useLocal?: boolean;
|
||||
}): Promise<FunctionReturn>;
|
||||
declare namespace googleAuth {
|
||||
export { FunctionReturn };
|
||||
}
|
||||
}): Promise<import("../../package-shared/types").APILoginFunctionReturn>;
|
||||
import http = require("http");
|
||||
type FunctionReturn = object | null;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// @ts-check
|
||||
|
||||
const http = require("http");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const encrypt = require("../../package-shared/functions/dsql/encrypt");
|
||||
const grabHostNames = require("../../package-shared/utils/grab-host-names");
|
||||
const apiGoogleLogin = require("../../package-shared/functions/api/users/social/api-google-login");
|
||||
@@ -11,14 +9,6 @@ const {
|
||||
writeAuthFile,
|
||||
} = require("../../package-shared/functions/backend/auth/write-auth-files");
|
||||
|
||||
/**
|
||||
* @typedef {object | null} FunctionReturn
|
||||
* @property {boolean} success - Did the function run successfully?
|
||||
* @property {import("../../types/user.td").DATASQUIREL_LoggedInUser | null} user - Returned User
|
||||
* @property {number} [dsqlUserId] - Dsql User Id
|
||||
* @property {string} [msg] - Response message
|
||||
*/
|
||||
|
||||
/**
|
||||
* SERVER FUNCTION: Login with google Function
|
||||
* ==============================================================================
|
||||
@@ -36,7 +26,7 @@ const {
|
||||
* @param {string | number} [params.apiUserID] - API user ID
|
||||
* @param {boolean} [params.useLocal] - Whether to use a remote database instead of API
|
||||
*
|
||||
* @returns { Promise<FunctionReturn> }
|
||||
* @returns { Promise<import("../../package-shared/types").APILoginFunctionReturn> }
|
||||
*/
|
||||
async function googleAuth({
|
||||
key,
|
||||
@@ -83,7 +73,7 @@ async function googleAuth({
|
||||
if (!token || token?.match(/ /)) {
|
||||
return {
|
||||
success: false,
|
||||
user: null,
|
||||
payload: null,
|
||||
msg: "Please enter Google Access Token",
|
||||
};
|
||||
}
|
||||
@@ -91,7 +81,7 @@ async function googleAuth({
|
||||
if (!database || database?.match(/ /)) {
|
||||
return {
|
||||
success: false,
|
||||
user: null,
|
||||
payload: null,
|
||||
msg: "Please provide database slug name you want to access",
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user