mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
🐛 Fixed email update magic link not working
no issue - Email update magic link was not sent out for sites which did not allow self signup as it didn't find the member on new email, which is expected. - Updates sending magic link check in case an old email is found to correctly trigger update email
This commit is contained in:
parent
5129c0d9fc
commit
d3bc625c35
@ -216,10 +216,11 @@ module.exports = function MembersApi({
|
||||
}
|
||||
|
||||
if (!allowSelfSignup) {
|
||||
const member = await users.get({email});
|
||||
const member = oldEmail ? await users.get({oldEmail}) : await users.get({email});
|
||||
if (member) {
|
||||
const tokenData = _.pick(req.body, ['oldEmail']);
|
||||
await sendEmailWithMagicLink({email, tokenData, requestedType: emailType});
|
||||
const forceEmailType = oldEmail ? true : false;
|
||||
await sendEmailWithMagicLink({email, tokenData, requestedType: emailType, options: {forceEmailType}});
|
||||
}
|
||||
} else {
|
||||
const tokenData = _.pick(req.body, ['labels', 'name', 'oldEmail']);
|
||||
|
Loading…
Reference in New Issue
Block a user