cnodejs / egg-cnode

CNode 社区 Egg 版本
https://cnodejs.org/
MIT License
1.48k stars 285 forks source link

登录问题 #120

Open LiQinFei opened 6 years ago

LiQinFei commented 6 years ago

登录出现异常

sinchang commented 6 years ago

信息再详细点吧

lzt9977 commented 6 years ago

image 注册完之后 不必去激活吧!直接密码登录会失败

`const localStrategy = app.passport.authenticate('local', { successRedirect: '/', failureRedirect: '/signin', });

router.post('/passport/local', localStrategy);`

这个东西会跳转到失败

ouyangxuanyun commented 6 years ago

如果不想激活邮箱就登录的话要注释掉 /app.js 中的

if (!existUser.active) {
      // 发送激活邮件
      return null;
    }

否则要配置邮件服务 /app/config/config.default.js

config.mail_opts = {
    host: 'smtp.126.com',
    port: 25,
    auth: {
      user: 'club@126.com',
      pass: 'club'
    },
    ignoreTLS: true
  };