From f3c3dcdda188bf8ff67fd85a6f020f02969d331b Mon Sep 17 00:00:00 2001 From: Princi Vershwal Date: Mon, 2 Dec 2024 13:38:24 +0530 Subject: [PATCH] Added undefined check for user in session service (#21773) No issue - user is undefined in the case when emailId doesn't exist in the db. --- ghost/core/core/server/api/endpoints/session.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/core/core/server/api/endpoints/session.js b/ghost/core/core/server/api/endpoints/session.js index d9f1e519b6..8ae5e42770 100644 --- a/ghost/core/core/server/api/endpoints/session.js +++ b/ghost/core/core/server/api/endpoints/session.js @@ -31,7 +31,7 @@ const controller = { let skipVerification = false; return models.User.getByEmail(object.username).then((user) => { - if (!user.hasLoggedIn()) { + if (user && !user.hasLoggedIn()) { skipVerification = true; }