Authored by 陈峰

登陆验证失败处理

... ... @@ -292,7 +292,7 @@ const wechat = {
callback: (req, res, next) => {
if (req.session && req.session.authState && req.session.authState === req.query.state) {
passport.authenticate('weixin', (err, user) => {
if (err) {
if (err || !user) {
log.error(`wechat authenticate error : ${JSON.stringify(err)}`);
return res.redirect(loginPage);
}
... ... @@ -320,7 +320,7 @@ const sina = {
callback: (req, res, next) => {
if (req.session && req.session.authState && req.session.authState === req.query.state) {
passport.authenticate('sina', (err, user) => {
if (err) {
if (err || !user) {
log.error(`sina authenticate error : ${JSON.stringify(err)}`);
return res.redirect(loginPage);
}
... ... @@ -373,7 +373,7 @@ const alipay = {
},
callback: (req, res, next) => {
passport.authenticate('alipay', (err, user) => {
if (err) {
if (err || !user) {
log.error(`alipay authenticate error : ${JSON.stringify(err)}`);
return res.redirect(loginPage);
}
... ...