1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-29 15:53:45 +00:00

improve mutual exclusion check for create with emails and password

This commit is contained in:
John Harrington
2025-12-30 09:09:08 -07:00
parent 5ea44140f0
commit 0fd81faabb

View File

@@ -82,7 +82,10 @@ export class SendCreateCommand {
const emails = req.emails ?? options.emails ?? undefined;
const maxAccessCount = req.maxAccessCount ?? options.maxAccessCount;
if (emails !== undefined && password !== undefined) {
const hasEmails = emails != null && emails.length > 0;
const hasPassword = password != null && password.trim().length > 0;
if (hasEmails && hasPassword) {
return Response.badRequest("--password and --emails are mutually exclusive.");
}