Skip to content

Commit

Permalink
refactor(middlewares): Rearrange setting user and saving session for …
Browse files Browse the repository at this point in the history
…clarity
  • Loading branch information
wajeht committed Jan 6, 2025
1 parent c03fe16 commit 3ed7ce1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middlewares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ export async function authenticationMiddleware(req: Request, res: Response, next
return res.redirect('/login');
}

req.user = user;
req.session.user = user;
req.session.save();
req.user = user;

next();
} catch (error) {
Expand Down

0 comments on commit 3ed7ce1

Please sign in to comment.