mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
🐛 Fixed incorrect payload creation for magic link token
no issue
- The extra payload added to magic link token included `name`, `labels` and `oldEmail`
- Refactor in commit [here](bf63ffe424 (diff-9f9ef757543bb9a90baba0d3bea76a83L157-R169)
) changed the `body` variable assignment causing the payload objection creation to not include the extra data from request body
- Updates `body` to `req.body` to use correct data from request
This commit is contained in:
parent
5b909735fd
commit
1acf7d40be
@ -202,14 +202,17 @@ module.exports = function MembersApi({
|
||||
});
|
||||
}
|
||||
}
|
||||
let extraPayload = {};
|
||||
if (!allowSelfSignup) {
|
||||
const member = await users.get({email});
|
||||
if (member) {
|
||||
Object.assign(payload, _.pick(body, ['oldEmail']));
|
||||
extraPayload = _.pick(req.body, ['oldEmail']);
|
||||
Object.assign(payload, extraPayload);
|
||||
await sendEmailWithMagicLink({email, requestedType: emailType, payload});
|
||||
}
|
||||
} else {
|
||||
Object.assign(payload, _.pick(body, ['labels', 'name', 'oldEmail']));
|
||||
extraPayload = _.pick(req.body, ['labels', 'name', 'oldEmail']);
|
||||
Object.assign(payload, extraPayload);
|
||||
await sendEmailWithMagicLink({email, requestedType: emailType, payload});
|
||||
}
|
||||
res.writeHead(201);
|
||||
|
Loading…
Reference in New Issue
Block a user