Skip to content

Commit

Permalink
for mozilla#55: Content-Type: text/text on oauth errors
Browse files Browse the repository at this point in the history
  • Loading branch information
groovecoder committed May 31, 2018
1 parent 7ca1bab commit 7a61a3c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions routes/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ router.get("/init", jsonParser, (req, res) => {
router.get("/confirmed", jsonParser, async (req, res) => {
if (!req.session.state) {
// TODO: Needs better error message
res.set("Content-Type", "text/text");
res.send("Who are you?");
return;
}
Expand All @@ -64,6 +65,7 @@ router.get("/confirmed", jsonParser, async (req, res) => {
});
} catch (err) {
console.error(err);
res.set("Content-Type", "text/text");
res.send(err);
}
});
Expand Down

0 comments on commit 7a61a3c

Please sign in to comment.