0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Protected against missing member for id token

no-issue

If a cookie still exists after a member has been deleted we can have
some strange requests, this just ensures that we check for existence.
This commit is contained in:
Fabien O'Carroll 2019-10-02 18:10:43 +07:00
parent af25cfb619
commit a6adfdd92c

View file

@ -102,6 +102,9 @@ module.exports = function MembersApi({
}
async function getMemberIdentityToken(email){
const member = await getMemberIdentityData(email);
if (!member) {
return null;
}
return encodeIdentityToken({sub: member.email});
}