Updates
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
HandleSocialDbFunctionParams,
|
||||
} from "../../../types";
|
||||
import grabDirNames from "../../../utils/backend/names/grab-dir-names";
|
||||
import grabDbFullName from "../../../utils/grab-db-full-name";
|
||||
|
||||
/**
|
||||
* # Handle Social DB
|
||||
@@ -25,9 +26,13 @@ export default async function handleSocialDb({
|
||||
additionalFields,
|
||||
debug,
|
||||
loginOnly,
|
||||
apiUserId,
|
||||
}: HandleSocialDbFunctionParams): Promise<APILoginFunctionReturn> {
|
||||
try {
|
||||
const finalDbName = database ? database : "datasquirel";
|
||||
const finalDbName = grabDbFullName({
|
||||
dbName: database,
|
||||
userId: apiUserId,
|
||||
});
|
||||
|
||||
const existingSocialUserQUery = `SELECT * FROM users WHERE email = ? AND social_login='1' AND social_platform = ? `;
|
||||
const existingSocialUserValues = [email, social_platform];
|
||||
|
||||
@@ -17,6 +17,7 @@ export default async function apiGoogleLogin({
|
||||
additionalData,
|
||||
debug,
|
||||
loginOnly,
|
||||
apiUserId,
|
||||
}: APIGoogleLoginFunctionParams): Promise<APILoginFunctionReturn> {
|
||||
try {
|
||||
const gUser: GoogleOauth2User | undefined = await new Promise(
|
||||
@@ -78,6 +79,7 @@ export default async function apiGoogleLogin({
|
||||
additionalFields,
|
||||
debug,
|
||||
loginOnly,
|
||||
apiUserId,
|
||||
});
|
||||
|
||||
////////////////////////////////////////
|
||||
@@ -85,7 +87,7 @@ export default async function apiGoogleLogin({
|
||||
////////////////////////////////////////
|
||||
|
||||
return { ...loggedInGoogleUser };
|
||||
} catch (/** @type {any} */ error: any) {
|
||||
} catch (error: any) {
|
||||
console.log(`api-google-login.ts ERROR: ${error.message}`);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user