From 5fa8ddbcf915e0251e4389aab3610418b6f7f399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 26 Aug 2024 14:52:30 -0400 Subject: [PATCH] test: fix spec --- public/openapi/read/confirm/code.yaml | 3 +++ src/controllers/index.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/openapi/read/confirm/code.yaml b/public/openapi/read/confirm/code.yaml index 9d55b016c1..9677cb1a66 100644 --- a/public/openapi/read/confirm/code.yaml +++ b/public/openapi/read/confirm/code.yaml @@ -24,6 +24,9 @@ get: error: type: string description: Translation key for client-side localisation + alreadyValidated: + type: boolean + description: set to true if the email was already validated required: - title - $ref: ../../components/schemas/CommonProps.yaml#/CommonProps \ No newline at end of file diff --git a/src/controllers/index.js b/src/controllers/index.js index b3542851ee..299050e37d 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -227,7 +227,7 @@ Controllers.confirmEmail = async (req, res) => { }); } try { - if (req.uid) { + if (req.loggedIn) { const emailValidated = await user.getUserField(req.uid, 'email:confirmed'); if (emailValidated) { return renderPage({ alreadyValidated: true });