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:
commit
5cb8b640da
1 changed files with 5 additions and 1 deletions
|
@ -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});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue