Fix deleteUserById response message for users without password
This commit is contained in:
parent
0fd10396f4
commit
811628a952
|
@ -5,9 +5,6 @@ import Stripe from "stripe";
|
||||||
import { DeleteUserBody } from "@/types/global";
|
import { DeleteUserBody } from "@/types/global";
|
||||||
import removeFile from "@/lib/api/storage/removeFile";
|
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(
|
export default async function deleteUserById(
|
||||||
userId: number,
|
userId: number,
|
||||||
body: DeleteUserBody,
|
body: DeleteUserBody,
|
||||||
|
@ -40,7 +37,8 @@ export default async function deleteUserById(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
response: "Invalid credentials.",
|
response:
|
||||||
|
"User has no password. Please reset your password from the forgot password page.",
|
||||||
status: 401, // Unauthorized
|
status: 401, // Unauthorized
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Ŝarĝante…
Reference in New Issue