Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
appujet committed Sep 1, 2023
1 parent 74cccf7 commit 7161b37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/api/routes/auth/AuthRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class AuthRouter {
this.router.get("/login", passport.authenticate("discord"), (req, res) => {
res.sendStatus(200);
});
this.router.get("/logout", (req, res, next) => {
req.logout(function (err) {
if (err) { return next(err); }
res.redirect(`${config.dashboard.website}/`);
});
});
this.router.get("/redirect", passport.authenticate("discord"), (req, res) => {
res.redirect(`${config.dashboard.website}/dashboard`);
});
Expand Down
3 changes: 1 addition & 2 deletions src/api/routes/guilds/GuildRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class GuildRouter {
private initializeRoutes() {
this.router.get("/:id", IsAuth, this.getGuild);
this.router.get("/:id/members", IsAuth, this.getGuildsMembers);
this.router.post("/:id/prefix", IsAuth, this.updateGuildPrefix);
this.router.put("/:id/prefix", IsAuth, this.updateGuildPrefix);
}
private async getGuild(req: Request, res: Response) {
const guild = await getGuild(req.params.id);
Expand All @@ -25,7 +25,6 @@ class GuildRouter {
}

private async updateGuildPrefix(req: Request, res: Response) {
console.log(req.params.id, req.body.prefix);
await ServerData.setPrefix(req.params.id, req.body.prefix);
return res.sendStatus(200);
}
Expand Down

0 comments on commit 7161b37

Please sign in to comment.