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:
parent
a6adfdd92c
commit
d02bab7ea8
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue