Updates
This commit is contained in:
parent
fdd3913f4f
commit
3695a75919
@ -2,4 +2,4 @@ import { APILoginFunctionReturn, HandleSocialDbFunctionParams } from "../../../t
|
|||||||
/**
|
/**
|
||||||
* # Handle Social DB
|
* # Handle Social DB
|
||||||
*/
|
*/
|
||||||
export default function handleSocialDb({ database, social_id, email, social_platform, payload, invitation, supEmail, additionalFields, useLocal, }: HandleSocialDbFunctionParams): Promise<APILoginFunctionReturn>;
|
export default function handleSocialDb({ database, social_id, email, social_platform, payload, invitation, supEmail, additionalFields, useLocal, debug, }: HandleSocialDbFunctionParams): Promise<APILoginFunctionReturn>;
|
||||||
|
@ -25,22 +25,30 @@ const loginSocialUser_1 = __importDefault(require("./loginSocialUser"));
|
|||||||
* # Handle Social DB
|
* # Handle Social DB
|
||||||
*/
|
*/
|
||||||
function handleSocialDb(_a) {
|
function handleSocialDb(_a) {
|
||||||
return __awaiter(this, arguments, void 0, function* ({ database, social_id, email, social_platform, payload, invitation, supEmail, additionalFields, useLocal, }) {
|
return __awaiter(this, arguments, void 0, function* ({ database, social_id, email, social_platform, payload, invitation, supEmail, additionalFields, useLocal, debug, }) {
|
||||||
try {
|
try {
|
||||||
const finalDbName = database ? database : "datasquirel";
|
const finalDbName = database ? database : "datasquirel";
|
||||||
const dbAppend = database ? `${finalDbName}.` : "";
|
const dbAppend = useLocal ? "" : `${finalDbName}.`;
|
||||||
const existingSocialIdUserQuery = `SELECT * FROM ${dbAppend}users WHERE social_id = ? AND social_login='1' AND social_platform = ? `;
|
const existingSocialIdUserQuery = `SELECT * FROM ${dbAppend}users WHERE social_id = ? AND social_login='1' AND social_platform = ? `;
|
||||||
const existingSocialIdUserValues = [
|
const existingSocialIdUserValues = [
|
||||||
social_id.toString(),
|
social_id.toString(),
|
||||||
social_platform,
|
social_platform,
|
||||||
];
|
];
|
||||||
|
if (debug) {
|
||||||
|
console.log("handleSocialDb:existingSocialIdUserQuery", existingSocialIdUserQuery);
|
||||||
|
console.log("handleSocialDb:existingSocialIdUserValues", existingSocialIdUserValues);
|
||||||
|
}
|
||||||
let existingSocialIdUser = yield (0, varDatabaseDbHandler_1.default)({
|
let existingSocialIdUser = yield (0, varDatabaseDbHandler_1.default)({
|
||||||
database: database ? database : "datasquirel",
|
database: database ? database : "datasquirel",
|
||||||
queryString: existingSocialIdUserQuery,
|
queryString: existingSocialIdUserQuery,
|
||||||
queryValuesArray: existingSocialIdUserValues,
|
queryValuesArray: existingSocialIdUserValues,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
if (existingSocialIdUser && existingSocialIdUser[0]) {
|
if (debug) {
|
||||||
|
console.log("handleSocialDb:existingSocialIdUser", existingSocialIdUser);
|
||||||
|
}
|
||||||
|
if (existingSocialIdUser === null || existingSocialIdUser === void 0 ? void 0 : existingSocialIdUser[0]) {
|
||||||
return yield (0, loginSocialUser_1.default)({
|
return yield (0, loginSocialUser_1.default)({
|
||||||
user: existingSocialIdUser[0],
|
user: existingSocialIdUser[0],
|
||||||
social_platform,
|
social_platform,
|
||||||
@ -48,6 +56,7 @@ function handleSocialDb(_a) {
|
|||||||
database,
|
database,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const finalEmail = email ? email : supEmail ? supEmail : null;
|
const finalEmail = email ? email : supEmail ? supEmail : null;
|
||||||
@ -59,11 +68,18 @@ function handleSocialDb(_a) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
const existingEmailOnlyQuery = `SELECT * FROM ${dbAppend}users WHERE email='${finalEmail}'`;
|
const existingEmailOnlyQuery = `SELECT * FROM ${dbAppend}users WHERE email='${finalEmail}'`;
|
||||||
|
if (debug) {
|
||||||
|
console.log("handleSocialDb:existingEmailOnlyQuery", existingEmailOnlyQuery);
|
||||||
|
}
|
||||||
let existingEmailOnly = yield (0, varDatabaseDbHandler_1.default)({
|
let existingEmailOnly = yield (0, varDatabaseDbHandler_1.default)({
|
||||||
database: database ? database : "datasquirel",
|
database: database ? database : "datasquirel",
|
||||||
queryString: existingEmailOnlyQuery,
|
queryString: existingEmailOnlyQuery,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
|
if (debug) {
|
||||||
|
console.log("handleSocialDb:existingEmailOnly", existingEmailOnly);
|
||||||
|
}
|
||||||
if (existingEmailOnly && existingEmailOnly[0]) {
|
if (existingEmailOnly && existingEmailOnly[0]) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
@ -78,6 +94,7 @@ function handleSocialDb(_a) {
|
|||||||
queryString: foundUserQuery,
|
queryString: foundUserQuery,
|
||||||
queryValuesArray: foundUserQueryValues,
|
queryValuesArray: foundUserQueryValues,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
if (foundUser && foundUser[0]) {
|
if (foundUser && foundUser[0]) {
|
||||||
return yield (0, loginSocialUser_1.default)({
|
return yield (0, loginSocialUser_1.default)({
|
||||||
@ -87,6 +104,7 @@ function handleSocialDb(_a) {
|
|||||||
database,
|
database,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const socialHashedPassword = (0, encrypt_1.default)({
|
const socialHashedPassword = (0, encrypt_1.default)({
|
||||||
@ -122,6 +140,7 @@ function handleSocialDb(_a) {
|
|||||||
database: database ? database : "datasquirel",
|
database: database ? database : "datasquirel",
|
||||||
queryString: newUserQueriedQuery,
|
queryString: newUserQueriedQuery,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
if (!newUserQueried || !newUserQueried[0])
|
if (!newUserQueried || !newUserQueried[0])
|
||||||
return {
|
return {
|
||||||
@ -180,6 +199,7 @@ function handleSocialDb(_a) {
|
|||||||
database,
|
database,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -11,6 +11,7 @@ type Param = {
|
|||||||
database?: string;
|
database?: string;
|
||||||
additionalFields?: string[];
|
additionalFields?: string[];
|
||||||
useLocal?: boolean;
|
useLocal?: boolean;
|
||||||
|
debug?: boolean;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Function to login social user
|
* Function to login social user
|
||||||
@ -18,5 +19,5 @@ type Param = {
|
|||||||
* @description This function logs in the user after 'handleSocialDb' function finishes
|
* @description This function logs in the user after 'handleSocialDb' function finishes
|
||||||
* the user creation or confirmation process
|
* the user creation or confirmation process
|
||||||
*/
|
*/
|
||||||
export default function loginSocialUser({ user, social_platform, invitation, database, additionalFields, useLocal, }: Param): Promise<APILoginFunctionReturn>;
|
export default function loginSocialUser({ user, social_platform, invitation, database, additionalFields, useLocal, debug, }: Param): Promise<APILoginFunctionReturn>;
|
||||||
export {};
|
export {};
|
||||||
|
@ -22,7 +22,7 @@ const varDatabaseDbHandler_1 = __importDefault(require("../../backend/varDatabas
|
|||||||
* the user creation or confirmation process
|
* the user creation or confirmation process
|
||||||
*/
|
*/
|
||||||
function loginSocialUser(_a) {
|
function loginSocialUser(_a) {
|
||||||
return __awaiter(this, arguments, void 0, function* ({ user, social_platform, invitation, database, additionalFields, useLocal, }) {
|
return __awaiter(this, arguments, void 0, function* ({ user, social_platform, invitation, database, additionalFields, useLocal, debug, }) {
|
||||||
const finalDbName = database ? database : "datasquirel";
|
const finalDbName = database ? database : "datasquirel";
|
||||||
const dbAppend = database ? `\`${finalDbName}\`.` : "";
|
const dbAppend = database ? `\`${finalDbName}\`.` : "";
|
||||||
const foundUserQuery = `SELECT * FROM ${dbAppend}\`users\` WHERE email=? AND social_id=? AND social_platform=?`;
|
const foundUserQuery = `SELECT * FROM ${dbAppend}\`users\` WHERE email=? AND social_id=? AND social_platform=?`;
|
||||||
@ -32,6 +32,7 @@ function loginSocialUser(_a) {
|
|||||||
queryString: foundUserQuery,
|
queryString: foundUserQuery,
|
||||||
queryValuesArray: foundUserValues,
|
queryValuesArray: foundUserValues,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
if (!(foundUser === null || foundUser === void 0 ? void 0 : foundUser[0]))
|
if (!(foundUser === null || foundUser === void 0 ? void 0 : foundUser[0]))
|
||||||
return {
|
return {
|
||||||
|
@ -2,4 +2,4 @@ import { APIGoogleLoginFunctionParams, APILoginFunctionReturn } from "../../../.
|
|||||||
/**
|
/**
|
||||||
* # API google login
|
* # API google login
|
||||||
*/
|
*/
|
||||||
export default function apiGoogleLogin({ token, database, additionalFields, additionalData, }: APIGoogleLoginFunctionParams): Promise<APILoginFunctionReturn>;
|
export default function apiGoogleLogin({ token, database, additionalFields, additionalData, debug, }: APIGoogleLoginFunctionParams): Promise<APILoginFunctionReturn>;
|
||||||
|
@ -20,7 +20,7 @@ const ejson_1 = __importDefault(require("../../../../utils/ejson"));
|
|||||||
* # API google login
|
* # API google login
|
||||||
*/
|
*/
|
||||||
function apiGoogleLogin(_a) {
|
function apiGoogleLogin(_a) {
|
||||||
return __awaiter(this, arguments, void 0, function* ({ token, database, additionalFields, additionalData, }) {
|
return __awaiter(this, arguments, void 0, function* ({ token, database, additionalFields, additionalData, debug, }) {
|
||||||
try {
|
try {
|
||||||
const gUser = yield new Promise((resolve, reject) => {
|
const gUser = yield new Promise((resolve, reject) => {
|
||||||
https_1.default
|
https_1.default
|
||||||
@ -80,6 +80,7 @@ function apiGoogleLogin(_a) {
|
|||||||
social_platform: "google",
|
social_platform: "google",
|
||||||
social_id: sub,
|
social_id: sub,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
2
dist/package-shared/types/index.d.ts
vendored
2
dist/package-shared/types/index.d.ts
vendored
@ -1073,6 +1073,7 @@ export type APIGoogleLoginFunctionParams = {
|
|||||||
additionalData?: {
|
additionalData?: {
|
||||||
[key: string]: string | number;
|
[key: string]: string | number;
|
||||||
};
|
};
|
||||||
|
debug?: boolean;
|
||||||
};
|
};
|
||||||
export type APIGoogleLoginFunction = (params: APIGoogleLoginFunctionParams) => Promise<APILoginFunctionReturn>;
|
export type APIGoogleLoginFunction = (params: APIGoogleLoginFunctionParams) => Promise<APILoginFunctionReturn>;
|
||||||
/**
|
/**
|
||||||
@ -1088,6 +1089,7 @@ export type HandleSocialDbFunctionParams = {
|
|||||||
supEmail?: string;
|
supEmail?: string;
|
||||||
additionalFields?: string[];
|
additionalFields?: string[];
|
||||||
useLocal?: boolean;
|
useLocal?: boolean;
|
||||||
|
debug?: boolean;
|
||||||
};
|
};
|
||||||
export type HandleSocialDbFunctionReturn = {
|
export type HandleSocialDbFunctionReturn = {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
|
3
dist/users/social/google-auth.d.ts
vendored
3
dist/users/social/google-auth.d.ts
vendored
@ -13,9 +13,10 @@ type Param = {
|
|||||||
};
|
};
|
||||||
apiUserID?: string | number;
|
apiUserID?: string | number;
|
||||||
useLocal?: boolean;
|
useLocal?: boolean;
|
||||||
|
debug?: boolean;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* # SERVER FUNCTION: Login with google Function
|
* # SERVER FUNCTION: Login with google Function
|
||||||
*/
|
*/
|
||||||
export default function googleAuth({ key, token, database, response, encryptionKey, encryptionSalt, additionalFields, additionalData, apiUserID, useLocal, }: Param): Promise<APILoginFunctionReturn>;
|
export default function googleAuth({ key, token, database, response, encryptionKey, encryptionSalt, additionalFields, additionalData, apiUserID, useLocal, debug, }: Param): Promise<APILoginFunctionReturn>;
|
||||||
export {};
|
export {};
|
||||||
|
3
dist/users/social/google-auth.js
vendored
3
dist/users/social/google-auth.js
vendored
@ -22,7 +22,7 @@ const write_auth_files_1 = require("../../package-shared/functions/backend/auth/
|
|||||||
* # SERVER FUNCTION: Login with google Function
|
* # SERVER FUNCTION: Login with google Function
|
||||||
*/
|
*/
|
||||||
function googleAuth(_a) {
|
function googleAuth(_a) {
|
||||||
return __awaiter(this, arguments, void 0, function* ({ key, token, database, response, encryptionKey, encryptionSalt, additionalFields, additionalData, apiUserID, useLocal, }) {
|
return __awaiter(this, arguments, void 0, function* ({ key, token, database, response, encryptionKey, encryptionSalt, additionalFields, additionalData, apiUserID, useLocal, debug, }) {
|
||||||
var _b;
|
var _b;
|
||||||
const grabedHostNames = (0, grab_host_names_1.default)();
|
const grabedHostNames = (0, grab_host_names_1.default)();
|
||||||
const { host, port, scheme } = grabedHostNames;
|
const { host, port, scheme } = grabedHostNames;
|
||||||
@ -78,6 +78,7 @@ function googleAuth(_a) {
|
|||||||
additionalFields,
|
additionalFields,
|
||||||
database: DSQL_DB_NAME,
|
database: DSQL_DB_NAME,
|
||||||
additionalData,
|
additionalData,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -24,10 +24,11 @@ export default async function handleSocialDb({
|
|||||||
supEmail,
|
supEmail,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
}: HandleSocialDbFunctionParams): Promise<APILoginFunctionReturn> {
|
}: HandleSocialDbFunctionParams): Promise<APILoginFunctionReturn> {
|
||||||
try {
|
try {
|
||||||
const finalDbName = database ? database : "datasquirel";
|
const finalDbName = database ? database : "datasquirel";
|
||||||
const dbAppend = database ? `${finalDbName}.` : "";
|
const dbAppend = useLocal ? "" : `${finalDbName}.`;
|
||||||
|
|
||||||
const existingSocialIdUserQuery = `SELECT * FROM ${dbAppend}users WHERE social_id = ? AND social_login='1' AND social_platform = ? `;
|
const existingSocialIdUserQuery = `SELECT * FROM ${dbAppend}users WHERE social_id = ? AND social_login='1' AND social_platform = ? `;
|
||||||
const existingSocialIdUserValues = [
|
const existingSocialIdUserValues = [
|
||||||
@ -35,14 +36,33 @@ export default async function handleSocialDb({
|
|||||||
social_platform,
|
social_platform,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
console.log(
|
||||||
|
"handleSocialDb:existingSocialIdUserQuery",
|
||||||
|
existingSocialIdUserQuery
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
"handleSocialDb:existingSocialIdUserValues",
|
||||||
|
existingSocialIdUserValues
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
let existingSocialIdUser = await varDatabaseDbHandler({
|
let existingSocialIdUser = await varDatabaseDbHandler({
|
||||||
database: database ? database : "datasquirel",
|
database: database ? database : "datasquirel",
|
||||||
queryString: existingSocialIdUserQuery,
|
queryString: existingSocialIdUserQuery,
|
||||||
queryValuesArray: existingSocialIdUserValues,
|
queryValuesArray: existingSocialIdUserValues,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (existingSocialIdUser && existingSocialIdUser[0]) {
|
if (debug) {
|
||||||
|
console.log(
|
||||||
|
"handleSocialDb:existingSocialIdUser",
|
||||||
|
existingSocialIdUser
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingSocialIdUser?.[0]) {
|
||||||
return await loginSocialUser({
|
return await loginSocialUser({
|
||||||
user: existingSocialIdUser[0],
|
user: existingSocialIdUser[0],
|
||||||
social_platform,
|
social_platform,
|
||||||
@ -50,6 +70,7 @@ export default async function handleSocialDb({
|
|||||||
database,
|
database,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,12 +86,24 @@ export default async function handleSocialDb({
|
|||||||
|
|
||||||
const existingEmailOnlyQuery = `SELECT * FROM ${dbAppend}users WHERE email='${finalEmail}'`;
|
const existingEmailOnlyQuery = `SELECT * FROM ${dbAppend}users WHERE email='${finalEmail}'`;
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
console.log(
|
||||||
|
"handleSocialDb:existingEmailOnlyQuery",
|
||||||
|
existingEmailOnlyQuery
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
let existingEmailOnly = await varDatabaseDbHandler({
|
let existingEmailOnly = await varDatabaseDbHandler({
|
||||||
database: database ? database : "datasquirel",
|
database: database ? database : "datasquirel",
|
||||||
queryString: existingEmailOnlyQuery,
|
queryString: existingEmailOnlyQuery,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
console.log("handleSocialDb:existingEmailOnly", existingEmailOnly);
|
||||||
|
}
|
||||||
|
|
||||||
if (existingEmailOnly && existingEmailOnly[0]) {
|
if (existingEmailOnly && existingEmailOnly[0]) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
@ -87,6 +120,7 @@ export default async function handleSocialDb({
|
|||||||
queryString: foundUserQuery,
|
queryString: foundUserQuery,
|
||||||
queryValuesArray: foundUserQueryValues,
|
queryValuesArray: foundUserQueryValues,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (foundUser && foundUser[0]) {
|
if (foundUser && foundUser[0]) {
|
||||||
@ -97,6 +131,7 @@ export default async function handleSocialDb({
|
|||||||
database,
|
database,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,6 +177,7 @@ export default async function handleSocialDb({
|
|||||||
database: database ? database : "datasquirel",
|
database: database ? database : "datasquirel",
|
||||||
queryString: newUserQueriedQuery,
|
queryString: newUserQueriedQuery,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!newUserQueried || !newUserQueried[0])
|
if (!newUserQueried || !newUserQueried[0])
|
||||||
@ -220,6 +256,7 @@ export default async function handleSocialDb({
|
|||||||
database,
|
database,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
|
@ -17,6 +17,7 @@ type Param = {
|
|||||||
database?: string;
|
database?: string;
|
||||||
additionalFields?: string[];
|
additionalFields?: string[];
|
||||||
useLocal?: boolean;
|
useLocal?: boolean;
|
||||||
|
debug?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,6 +33,7 @@ export default async function loginSocialUser({
|
|||||||
database,
|
database,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
}: Param): Promise<APILoginFunctionReturn> {
|
}: Param): Promise<APILoginFunctionReturn> {
|
||||||
const finalDbName = database ? database : "datasquirel";
|
const finalDbName = database ? database : "datasquirel";
|
||||||
const dbAppend = database ? `\`${finalDbName}\`.` : "";
|
const dbAppend = database ? `\`${finalDbName}\`.` : "";
|
||||||
@ -44,6 +46,7 @@ export default async function loginSocialUser({
|
|||||||
queryString: foundUserQuery,
|
queryString: foundUserQuery,
|
||||||
queryValuesArray: foundUserValues,
|
queryValuesArray: foundUserValues,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!foundUser?.[0])
|
if (!foundUser?.[0])
|
||||||
|
@ -15,6 +15,7 @@ export default async function apiGoogleLogin({
|
|||||||
database,
|
database,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
additionalData,
|
additionalData,
|
||||||
|
debug,
|
||||||
}: APIGoogleLoginFunctionParams): Promise<APILoginFunctionReturn> {
|
}: APIGoogleLoginFunctionParams): Promise<APILoginFunctionReturn> {
|
||||||
try {
|
try {
|
||||||
const gUser: GoogleOauth2User | undefined = await new Promise(
|
const gUser: GoogleOauth2User | undefined = await new Promise(
|
||||||
@ -87,6 +88,7 @@ export default async function apiGoogleLogin({
|
|||||||
social_platform: "google",
|
social_platform: "google",
|
||||||
social_id: sub,
|
social_id: sub,
|
||||||
additionalFields,
|
additionalFields,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
@ -1257,6 +1257,7 @@ export type APIGoogleLoginFunctionParams = {
|
|||||||
database: string;
|
database: string;
|
||||||
additionalFields?: string[];
|
additionalFields?: string[];
|
||||||
additionalData?: { [key: string]: string | number };
|
additionalData?: { [key: string]: string | number };
|
||||||
|
debug?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type APIGoogleLoginFunction = (
|
export type APIGoogleLoginFunction = (
|
||||||
@ -1276,6 +1277,7 @@ export type HandleSocialDbFunctionParams = {
|
|||||||
supEmail?: string;
|
supEmail?: string;
|
||||||
additionalFields?: string[];
|
additionalFields?: string[];
|
||||||
useLocal?: boolean;
|
useLocal?: boolean;
|
||||||
|
debug?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type HandleSocialDbFunctionReturn = {
|
export type HandleSocialDbFunctionReturn = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "3.7.5",
|
"version": "3.7.6",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -17,6 +17,7 @@ type Param = {
|
|||||||
additionalData?: { [s: string]: string | number };
|
additionalData?: { [s: string]: string | number };
|
||||||
apiUserID?: string | number;
|
apiUserID?: string | number;
|
||||||
useLocal?: boolean;
|
useLocal?: boolean;
|
||||||
|
debug?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,6 +34,7 @@ export default async function googleAuth({
|
|||||||
additionalData,
|
additionalData,
|
||||||
apiUserID,
|
apiUserID,
|
||||||
useLocal,
|
useLocal,
|
||||||
|
debug,
|
||||||
}: Param): Promise<APILoginFunctionReturn> {
|
}: Param): Promise<APILoginFunctionReturn> {
|
||||||
const grabedHostNames = grabHostNames();
|
const grabedHostNames = grabHostNames();
|
||||||
const { host, port, scheme } = grabedHostNames;
|
const { host, port, scheme } = grabedHostNames;
|
||||||
@ -101,6 +103,7 @@ export default async function googleAuth({
|
|||||||
additionalFields,
|
additionalFields,
|
||||||
database: DSQL_DB_NAME,
|
database: DSQL_DB_NAME,
|
||||||
additionalData,
|
additionalData,
|
||||||
|
debug,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user