Updates
This commit is contained in:
@@ -19,6 +19,7 @@ type Param = {
|
||||
apiUserID?: string | number;
|
||||
debug?: boolean;
|
||||
secureCookie?: boolean;
|
||||
loginOnly?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -36,6 +37,7 @@ export default async function googleAuth({
|
||||
apiUserID,
|
||||
debug,
|
||||
secureCookie,
|
||||
loginOnly,
|
||||
}: Param): Promise<APILoginFunctionReturn> {
|
||||
const grabedHostNames = grabHostNames({
|
||||
userId: apiUserID || process.env.DSQL_API_USER_ID,
|
||||
|
||||
@@ -24,6 +24,7 @@ export default async function handleSocialDb({
|
||||
supEmail,
|
||||
additionalFields,
|
||||
debug,
|
||||
loginOnly,
|
||||
}: HandleSocialDbFunctionParams): Promise<APILoginFunctionReturn> {
|
||||
try {
|
||||
const finalDbName = global.DSQL_USE_LOCAL
|
||||
@@ -73,6 +74,12 @@ export default async function handleSocialDb({
|
||||
additionalFields,
|
||||
debug,
|
||||
});
|
||||
} else if (loginOnly) {
|
||||
return {
|
||||
success: false,
|
||||
payload: null,
|
||||
msg: "User Does not Exist",
|
||||
};
|
||||
}
|
||||
|
||||
const finalEmail = email ? email : supEmail ? supEmail : null;
|
||||
|
||||
@@ -16,6 +16,7 @@ export default async function apiGoogleLogin({
|
||||
additionalFields,
|
||||
additionalData,
|
||||
debug,
|
||||
loginOnly,
|
||||
}: APIGoogleLoginFunctionParams): Promise<APILoginFunctionReturn> {
|
||||
try {
|
||||
const gUser: GoogleOauth2User | undefined = await new Promise(
|
||||
@@ -77,6 +78,7 @@ export default async function apiGoogleLogin({
|
||||
social_id: sub,
|
||||
additionalFields,
|
||||
debug,
|
||||
loginOnly,
|
||||
});
|
||||
|
||||
////////////////////////////////////////
|
||||
|
||||
@@ -1266,6 +1266,7 @@ export type APIGoogleLoginFunctionParams = {
|
||||
additionalFields?: string[];
|
||||
additionalData?: { [key: string]: string | number };
|
||||
debug?: boolean;
|
||||
loginOnly?: boolean;
|
||||
};
|
||||
|
||||
export type APIGoogleLoginFunction = (
|
||||
@@ -1285,6 +1286,7 @@ export type HandleSocialDbFunctionParams = {
|
||||
supEmail?: string;
|
||||
additionalFields?: string[];
|
||||
debug?: boolean;
|
||||
loginOnly?: boolean;
|
||||
};
|
||||
|
||||
export type HandleSocialDbFunctionReturn = {
|
||||
|
||||
Reference in New Issue
Block a user