mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-29 10:39:19 +01:00
fix(core): fix ESLint console warnings, Twitter redirect, and and scope usage (#1388)
* Use validator.js instead of regexp for validations in User Schema. * Disables "Unexpected console statement no-console" warnings * Fixes redirection to wrong URL after login with social networks. * Use ViewModel vm instead of $scope in manage social accounts controller. * preserving the option to redirect to a specific URL as done in saveOAuthUserProfile() (thanks to @OneOfTheWorld for pointing out)
This commit is contained in:
@@ -104,7 +104,7 @@ exports.oauthCallback = function (strategy) {
|
||||
var sessionRedirectURL = req.session.redirect_to;
|
||||
delete req.session.redirect_to;
|
||||
|
||||
passport.authenticate(strategy, function (err, user, redirectURL) {
|
||||
passport.authenticate(strategy, function (err, user, info) {
|
||||
if (err) {
|
||||
return res.redirect('/authentication/signin?err=' + encodeURIComponent(errorHandler.getErrorMessage(err)));
|
||||
}
|
||||
@@ -116,7 +116,7 @@ exports.oauthCallback = function (strategy) {
|
||||
return res.redirect('/authentication/signin');
|
||||
}
|
||||
|
||||
return res.redirect(redirectURL || sessionRedirectURL || '/');
|
||||
return res.redirect(info || sessionRedirectURL || '/');
|
||||
});
|
||||
})(req, res, next);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user