0
我想创建一个帐户后,自动登录用户。 需要将它们重定向到/auth/local/
发送他刚刚创建的用户和密码。注册后自动登录
这是我middleware/signup.js
'use strict';
module.exports = function(app) {
return function(req, res, next) {
const body = req.body;
// Get the user service and `create` a new user
app.service('users').create({
email: body.email,
password: body.password
})
// Then redirect to the login page
.then(user => app.post('/auth/local', function(req, res){
req.body(user);
}))
// On errors, just call our error middleware
.catch(next);
};
};
这不给任何错误...只是一个永恒的负载创建一个用户后。 帮助