Updates
This commit is contained in:
@@ -163,8 +163,8 @@ export default async function apiCreateUser({
|
||||
},
|
||||
});
|
||||
|
||||
if (addUser?.payload?.insertId) {
|
||||
const newlyAddedUserQuery = `SELECT id,uuid,first_name,last_name,email,username,image,image_thumbnail,verification_status FROM ${dbFullName}.users WHERE id='${addUser.payload.insertId}'`;
|
||||
if (addUser?.postInsertReturn?.insertId) {
|
||||
const newlyAddedUserQuery = `SELECT id,uuid,first_name,last_name,email,username,image,image_thumbnail,verification_status FROM ${dbFullName}.users WHERE id='${addUser.postInsertReturn.insertId}'`;
|
||||
|
||||
const newlyAddedUser = (await dbHandler({
|
||||
query: newlyAddedUserQuery,
|
||||
|
||||
@@ -184,7 +184,7 @@ export default async function apiLoginUser({
|
||||
const resposeObject: APIResponseObject = {
|
||||
success: true,
|
||||
msg: "Login Successful",
|
||||
payload: userPayload,
|
||||
singleRes: userPayload,
|
||||
userId: foundUser[0].id,
|
||||
csrf: csrfKey,
|
||||
};
|
||||
|
||||
@@ -48,6 +48,6 @@ export default async function apiResetUserPassword({
|
||||
|
||||
return {
|
||||
success: true,
|
||||
payload: updateUser,
|
||||
singleRes: updateUser,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -81,6 +81,6 @@ export default async function apiUpdateUser({
|
||||
|
||||
return {
|
||||
success: true,
|
||||
payload: updateUser,
|
||||
singleRes: updateUser,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import handleSocialDb from "../../social-login/handleSocialDb";
|
||||
import githubLogin from "../../social-login/githubLogin";
|
||||
import camelJoinedtoCamelSpace from "../../../../utils/camelJoinedtoCamelSpace";
|
||||
import { APILoginFunctionReturn } from "../../../../types";
|
||||
import { APILoginFunctionReturn, APIResponseObject } from "../../../../types";
|
||||
|
||||
type Param = {
|
||||
code?: string;
|
||||
@@ -24,7 +24,7 @@ export default async function apiGithubLogin({
|
||||
additionalFields,
|
||||
email,
|
||||
additionalData,
|
||||
}: Param): Promise<APILoginFunctionReturn> {
|
||||
}: Param): Promise<APIResponseObject> {
|
||||
if (!code || !clientId || !clientSecret || !database) {
|
||||
return {
|
||||
success: false,
|
||||
|
||||
Reference in New Issue
Block a user