Skip to content

Commit

Permalink
🐛 Fix failure url for dashboard auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Androz2091 committed Jan 30, 2021
1 parent 95d3dce commit f440eb1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dashboard/routes/discord.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ router.get("/login", async function(req, res) {
});

router.get("/callback", async (req, res) => {
if(!req.query.code) return res.redirect(req.client.config.dashboard.failureURL);
if(req.query.state && req.query.state.startsWith("invite")){
if(req.query.code){
const guildID = req.query.state.substr("invite".length, req.query.state.length);
req.client.knownGuilds.push({ id: guildID, user: req.user.id });
return res.redirect("/manage/"+guildID);
} else {
return res.redirect("/selector");
}
}
if(!req.query.code) res.redirect(req.client.config.failureURL);
const redirectURL = req.client.states[req.query.state] || "/selector";
const params = new URLSearchParams();
params.set("grant_type", "authorization_code");
Expand Down

0 comments on commit f440eb1

Please sign in to comment.