Skip to content

Commit faacec5

Browse files
committed
fix(auth): fix google and microsoft callback redirect path
1 parent 2e9af52 commit faacec5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes/user.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ router.get('/signin/google', passport.authenticate("google", {scope: ["profile",
6464
router.get('/signin/google/callback', passport.authenticate("google", {failureRedirect: "/login", session: false}),
6565
function (req, res) {
6666
let token = req.user.token;
67-
res.redirect(config.hostUI + ":" + config.portUI + "/#/login?token=" + token);
67+
res.redirect(config.hostUI + `${config.portUI ? `:${config.portUI}` : ``}` + "/#/login?token=" + token);
6868
}
6969
);
7070

@@ -73,7 +73,7 @@ router.get('/signin/microsoft', passport.authenticate("microsoft", {scope: ["htt
7373
router.get('/signin/microsoft/callback', passport.authenticate("microsoft", {failureRedirect: "/login", session: false}),
7474
function (req, res) {
7575
let token = req.user.token;
76-
res.redirect(config.hostUI + ":" + config.portUI + "/#/login?token=" + token);
76+
res.redirect(config.hostUI + `${config.portUI ? `:${config.portUI}` : ``}` + "/#/login?token=" + token);
7777
}
7878
);
7979

0 commit comments

Comments
 (0)