Enhance user management: update User context and API to include first name, last name, and admin status

This commit is contained in:
2025-11-21 17:10:48 +01:00
parent 1076b12668
commit ca8030afbd
4 changed files with 17 additions and 6 deletions

View File

@@ -12,6 +12,9 @@ router.post("/login", async (req, res) => {
if (result.success) {
const token = await generateToken({
username: result.data.username,
is_admin: result.data.is_admin,
first_name: result.data.first_name,
last_name: result.data.last_name,
role: result.data.role,
});
res.status(200).json({ message: "Login successful", token });