Skip to content

Node.js based forum software built for the modern web

test: fix spec

Barış Soner Uşaklı5fa8ddbcf915
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 });