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; } }