mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-22 18:26:12 +01:00
📬 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:
parent
191cd3983c
commit
639a60cf19
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue