[oauth] fix development redirecting to live
This commit is contained in:
parent
a50750e829
commit
65e6444e57
|
@ -431,7 +431,7 @@ router.get('/user/social/:provider', handleErrorAsync(async (req, res) => {
|
||||||
if (!req.session.socialRedirect) {
|
if (!req.session.socialRedirect) {
|
||||||
return '/' + config.user.route;
|
return '/' + config.user.route;
|
||||||
}
|
}
|
||||||
const host = buildLocaleList(config.locale, true)[req.session.socialRedirect].url;
|
const host = process.env.NODE_ENV === 'development' ? '' : buildLocaleList(config.locale, true)[req.session.socialRedirect].url;
|
||||||
delete req.session.socialRedirect;
|
delete req.session.socialRedirect;
|
||||||
|
|
||||||
return `${host}/api/user/social-redirect-callback/${encodeURIComponent(token)}`;
|
return `${host}/api/user/social-redirect-callback/${encodeURIComponent(token)}`;
|
||||||
|
|
Reference in New Issue