Revise and finish login with GitHub

This commit is contained in:
Tuan Dang
2023-08-03 15:34:02 +07:00
parent 960aceed29
commit 2293abfc80
11 changed files with 266 additions and 176 deletions
+23
View File
@@ -41,6 +41,29 @@ router.get(
ssoController.redirectSSO
);
router.get(
"/redirect/github",
authLimiter,
(req, res, next) => {
passport.authenticate("github", {
session: false,
...(req.query.callback_port ? {
state: req.query.callback_port as string
} : {})
})(req, res, next);
}
);
router.get(
"/github",
authLimiter,
passport.authenticate("github", {
failureRedirect: "/login/provider/error",
session: false
}),
ssoController.redirectSSO
);
router.get(
"/redirect/saml2/:ssoIdentifier",
authLimiter,