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);
};
};
這不給任何錯誤...只是一個永恆的負載創建一個用戶後。 幫助