This commit is contained in:
Benjamin Toby
2025-01-28 19:43:16 +01:00
parent 81cf010cb5
commit 35fec57590
856 changed files with 5362 additions and 2266 deletions
@@ -15,6 +15,7 @@ export default async function apiGoogleLogin({
database,
additionalFields,
additionalData,
debug,
}: APIGoogleLoginFunctionParams): Promise<APILoginFunctionReturn> {
try {
const gUser: GoogleOauth2User | undefined = await new Promise(
@@ -45,18 +46,6 @@ export default async function apiGoogleLogin({
if (!gUser?.email_verified) throw new Error("No Google User.");
////////////////////////////////////////
////////////////////////////////////////
////////////////////////////////////////
if (!database || typeof database != "string" || database?.match(/ /)) {
return {
success: false,
payload: undefined,
msg: "Please provide a database slug(database name in lowercase with no spaces)",
};
}
/**
* Create new user folder and file
*
@@ -65,7 +54,6 @@ export default async function apiGoogleLogin({
const { given_name, family_name, email, sub, picture } = gUser;
/** @type {Object<string, any>} */
let payloadObject: { [s: string]: any } = {
email: email,
first_name: given_name,
@@ -88,6 +76,7 @@ export default async function apiGoogleLogin({
social_platform: "google",
social_id: sub,
additionalFields,
debug,
});
////////////////////////////////////////