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

Made sure we throw an error for invalid session

no-issue
This commit is contained in:
Fabien O'Carroll 2019-10-02 18:12:06 +07:00
parent a6adfdd92c
commit d02bab7ea8

View file

@ -318,7 +318,14 @@ class MembersSSR {
*/
async getIdentityTokenForMemberFromSession(req, res) {
const email = this._getSessionCookies(req, res);
return this._getMemberIdentityToken(email);
const token = await this._getMemberIdentityToken(email);
if (!token) {
this.deleteSession(req, res);
throw new BadRequestError({
message: 'Invalid session, could not get identity token'
});
}
return token;
}
}