Skip to content

Commit

Permalink
backend: return email address of current user
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Sep 9, 2024
1 parent cfab86e commit 34f2de1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/controllers/SessionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export const update = async (
export const me = async (req: Request, res: Response): Promise<Response> => {
const token: string = req.cookies.jrt;
const user = await FindUserFromToken(token);
const { id, profile, super: superAdmin } = user;
const { id, profile, email, super: superAdmin } = user;

if (!token) {
throw new AppError("ERR_SESSION_EXPIRED", 401);
}

return res.json({ id, profile, super: superAdmin });
return res.json({ id, profile, email, super: superAdmin });
};

export const remove = async (
Expand Down

0 comments on commit 34f2de1

Please sign in to comment.