Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Redirect to frontend error page
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jun 25, 2019
1 parent 268dc56 commit 9837481
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "staart",
"version": "1.0.40",
"version": "1.0.41",
"main": "index.js",
"repository": "[email protected]:AnandChowdhary/staart.git",
"author": "Anand Chowdhary <[email protected]>",
Expand Down
9 changes: 4 additions & 5 deletions src/controllers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,12 @@ export class AuthController {
);
const service = req.params.service;
const code = `${BASE_URL}/auth${req.path}?${stringify(req.query)}`;
if (service === "github")
return res.json(go(await githubCallback(code, res.locals)));
if (service === "github") return go(await githubCallback(code, res.locals));
if (service === "facebook")
return res.json(go(await facebookCallback(code, res.locals)));
return go(await facebookCallback(code, res.locals));
if (service === "salesforce")
return res.json(go(await salesforceCallback(code, res.locals)));
throw new Error(ErrorCode.NOT_FOUND);
return go(await salesforceCallback(code, res.locals));
safeRedirect(req, res, `${FRONTEND_URL}/errors/oauth`);
}

@Get("oauth/github")
Expand Down

0 comments on commit 9837481

Please sign in to comment.