Skip to content

Commit

Permalink
Fix logout
Browse files Browse the repository at this point in the history
Fix the logout route to really log the user out. This was broken since
a34a468 by removing the call to the `logout()` method.
  • Loading branch information
mgrabovsky committed Jul 24, 2023
1 parent e6fa30c commit 756212c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/routes/authRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function (app: Express) {
failureFlash: true,
successRedirect: '/',
failureRedirect: '/login',
})
}),
);

/**
Expand All @@ -93,11 +93,14 @@ export default function (app: Express) {
/**
* This will be called after passport.authenticate('saml')
*/
redirectBack
(req, res) => redirectBack(req, res),
);

app.get('/logout', function (req, res) {
redirectBack(req, res);
app.get('/logout', function (req, res, next) {
req.logout({}, (err) => {
if (err) return next(err);
redirectBack(req, res);
});
});

app.get('/current_user', (req, res) => {
Expand Down

0 comments on commit 756212c

Please sign in to comment.