fix: correct req.user property from id to userId in controllers

This commit is contained in:
2026-02-02 00:58:35 -06:00
parent 203e6069c8
commit d25ec6ebe7
3 changed files with 4 additions and 4 deletions

View File

@@ -254,7 +254,7 @@ export async function deleteUser(
}
// Prevent admin from deleting themselves
if (req.user?.id === userId) {
if (req.user?.userId === userId) {
res.status(400).json({
success: false,
error: 'Cannot deactivate your own account',
@@ -305,7 +305,7 @@ export async function changePassword(
}
// Only allow users to change their own password
if (req.user?.id !== userId) {
if (req.user?.userId !== userId) {
res.status(403).json({
success: false,
error: 'You can only change your own password',