Fix deleteUserById response message for users without password

This commit is contained in:
daniel31x13 2024-05-21 08:00:44 -04:00
parent 0fd10396f4
commit 811628a952

View File

@ -5,9 +5,6 @@ import Stripe from "stripe";
import { DeleteUserBody } from "@/types/global";
import removeFile from "@/lib/api/storage/removeFile";
const keycloakEnabled = process.env.KEYCLOAK_CLIENT_SECRET;
const authentikEnabled = process.env.AUTHENTIK_CLIENT_SECRET;
export default async function deleteUserById(
userId: number,
body: DeleteUserBody,
@ -40,7 +37,8 @@ export default async function deleteUserById(
}
} else {
return {
response: "Invalid credentials.",
response:
"User has no password. Please reset your password from the forgot password page.",
status: 401, // Unauthorized
};
}