Skip to content

Commit

Permalink
don't use session
Browse files Browse the repository at this point in the history
  • Loading branch information
LarmuseauNiels committed Apr 6, 2023
1 parent f428d52 commit a4cf9e8
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions modules/WebApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,10 @@ export class WebApi {
"/callback",
passport.authenticate("discord", { failureRedirect: "/" }),
function (req, res) {
res.redirect("/authtest");
res.json(req);
} // auth success
);

app.get("/authtest", this.checkAuth, function (req, res) {
res.json(req);
});

app.get("/", function (req, res) {
res.send("KRAKEN API");
});
Expand Down Expand Up @@ -158,9 +154,4 @@ export class WebApi {
console.log("WebApi listening on port 3000");
});
}

checkAuth(req, res, next) {
if (req.isAuthenticated()) return next();
res.send("not logged in :(");
}
}

0 comments on commit a4cf9e8

Please sign in to comment.