0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-15 03:01:37 -05:00

Merge pull request #454 from skattyadz/login-on-register

Immediately log in when a new user account is created
This commit is contained in:
Hannah Wolfe 2013-08-19 13:46:06 -07:00
commit 5cb8b640da

View file

@ -129,7 +129,11 @@ adminControllers = {
email_address: email,
password: password
}).then(function (user) {
res.json(200, {redirect: '/ghost/login/'});
// Automatically log the new user in, unless created by an existing account
if (req.session.user === undefined) {
req.session.user = user.id;
}
res.json(200, {redirect: '/ghost/'});
}, function (error) {
res.json(401, {message: error.message});
});