Skip to content

Commit cce23b6

Browse files
committed
feat: add file and database API routes, client authentication, and UI components for file management.
1 parent 06551ef commit cce23b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/client/middlewares/auth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@ export const clientAuthMiddleware = async (req: Request, res: Response, next: Ne
5050
return;
5151
}
5252

53-
(req as any).user = {
53+
const user = {
5454
id: payload.userId,
5555
username: payload.username,
5656
role: payload.role,
5757
sessionId: payload.sessionId
5858
};
5959

60+
(req as any).user = user;
61+
res.locals.user = user;
62+
6063
next();
6164
};

0 commit comments

Comments
 (0)