From 639a60cf19f7fdd04926e5ed04e89693f55f0bd3 Mon Sep 17 00:00:00 2001 From: Shahryar Tayeb <48182832+shtayeb@users.noreply.github.com> Date: Thu, 22 Jan 2026 04:03:49 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=AC=20fix:=20Email=20Verification=20Ha?= =?UTF-8?q?ndling=20in=20Create-User=20Command=20(#11408)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: email verification handling in create-user command * set emailVerified to true when the input is 'y' * normalize email verification input and set emailVerified to true by default --- config/create-user.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/create-user.js b/config/create-user.js index 30cd6669ee..3688d736e2 100644 --- a/config/create-user.js +++ b/config/create-user.js @@ -14,7 +14,7 @@ const connect = require('./connect'); console.purple('--------------------------'); if (process.argv.length < 5) { - console.orange('Usage: npm run create-user [--email-verified=false]'); + console.orange('Usage: npm run create-user -- [--email-verified=false]'); console.orange('Note: if you do not pass in the arguments, you will be prompted for them.'); console.orange( 'If you really need to pass in the password, you can do so as the 4th argument (not recommended for security).', @@ -88,7 +88,11 @@ If \`n\`, and email service is configured, the user will be sent a verification If \`n\`, and email service is not configured, you must have the \`ALLOW_UNVERIFIED_EMAIL_LOGIN\` .env variable set to true, or the user will need to attempt logging in to have a verification link sent to them.`); - if (emailVerifiedInput.toLowerCase() === 'n') { + const normalizedEmailVerifiedInput = emailVerifiedInput.trim().toLowerCase() + + emailVerified = true + + if (normalizedEmailVerifiedInput === 'n') { emailVerified = false; } }