Skip to content

Commit

Permalink
Fixed Logout function, added TODO in auth.js (#296)
Browse files Browse the repository at this point in the history
* Fixed logout function, added TODO in auth.js

* Fixed logout function, added TODO in auth.js

* Deleted switch test case in /src/utility/auth.js

---------

Co-authored-by: tschiken <[email protected]>
  • Loading branch information
tshikenn and tschiken authored Dec 29, 2024
1 parent 0dd901f commit 6ee1d26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 5 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ app.get(
}
}
);
app.get("/logout", (req, res) => {
req.logout();
res.redirect("/");
app.get('/logout', function(req, res, next) {
req.logout(function(err) {
if (err) { return next(err); }
res.redirect('/');
});
});
// END Steam API Calls.

Expand Down
5 changes: 1 addition & 4 deletions src/utility/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ passport.deserializeUser((obj, done) => {
function strategyForEnvironment() {
let strategy;
switch (process.env.NODE_ENV) {
case "test":
const newUser = new user();
strategy = new MockStrategy({ name: "steam", user: newUser, passReqToCallback: true }, returnStrategy);
break;
// #TODO: Fix crashing while on dev environment. "cb is not a function" error. Discord @tshiken
default:
strategy = new SteamStrategy(
{
Expand Down

0 comments on commit 6ee1d26

Please sign in to comment.