📬 fix: Email Verification Handling in Create-User Command (#11408)

* 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
This commit is contained in:
Shahryar Tayeb 2026-01-22 04:03:49 +09:00 committed by GitHub
parent 191cd3983c
commit 639a60cf19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,7 @@ const connect = require('./connect');
console.purple('--------------------------');
if (process.argv.length < 5) {
console.orange('Usage: npm run create-user <email> <name> <username> [--email-verified=false]');
console.orange('Usage: npm run create-user -- <email> <name> <username> [--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;
}
}