0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Accept Invitation: Generate Slug from Name

No issue, but ref #4211
This commit is contained in:
Felix Rieseberg 2014-10-13 08:22:27 -04:00
parent 92191234fb
commit 7bb38f8c7b

View file

@ -139,7 +139,8 @@ authentication = {
var dbHash = response.settings[0].value;
return dataProvider.User.resetPassword(resetToken, newPassword, ne2Password, dbHash);
}).then(function (user) {
return dataProvider.User.edit({name: name, email: email}, {id: user.id});
// Setting the slug to '' has the model regenerate the slug from the user's name
return dataProvider.User.edit({name: name, email: email, slug: ''}, {id: user.id});
}).then(function () {
return Promise.resolve({invitation: [{message: 'Invitation accepted.'}]});
}).catch(function (error) {