Enhance dashboard layout and sidebar functionality; improve session metrics calculations and API error handling

This commit is contained in:
2025-05-22 21:53:18 +02:00
parent 8dcb892ae9
commit cbbdc8a1dc
9 changed files with 296 additions and 205 deletions

View File

@ -34,12 +34,9 @@ export default async function handler(
});
if (!user) {
return res
.status(400)
.json({
error:
"Invalid or expired token. Please request a new password reset.",
});
return res.status(400).json({
error: "Invalid or expired token. Please request a new password reset.",
});
}
const hash = await bcrypt.hash(password, 10);
@ -59,10 +56,8 @@ export default async function handler(
} catch (error) {
console.error("Reset password error:", error); // Log the error for server-side debugging
// Provide a generic error message to the client
return res
.status(500)
.json({
error: "An internal server error occurred. Please try again later.",
});
return res.status(500).json({
error: "An internal server error occurred. Please try again later.",
});
}
}