diff --git a/cli/commands/resetUserSecurityKeys.ts b/cli/commands/resetUserSecurityKeys.ts index 84af7cec..fdae0ebd 100644 --- a/cli/commands/resetUserSecurityKeys.ts +++ b/cli/commands/resetUserSecurityKeys.ts @@ -6,16 +6,19 @@ type ResetUserSecurityKeysArgs = { email: string; }; -export const resetUserSecurityKeys: CommandModule<{}, ResetUserSecurityKeysArgs> = { +export const resetUserSecurityKeys: CommandModule< + {}, + ResetUserSecurityKeysArgs +> = { command: "reset-user-security-keys", - describe: "Reset a user's security keys (passkeys) by deleting all their webauthn credentials", + describe: + "Reset a user's security keys (passkeys) by deleting all their webauthn credentials", builder: (yargs) => { - return yargs - .option("email", { - type: "string", - demandOption: true, - describe: "User email address" - }); + return yargs.option("email", { + type: "string", + demandOption: true, + describe: "User email address" + }); }, handler: async (argv: { email: string }) => { try { @@ -48,7 +51,9 @@ export const resetUserSecurityKeys: CommandModule<{}, ResetUserSecurityKeysArgs> process.exit(0); } - console.log(`Found ${userSecurityKeys.length} security key(s) for user '${email}'`); + console.log( + `Found ${userSecurityKeys.length} security key(s) for user '${email}'` + ); // Delete all security keys for the user await db @@ -64,4 +69,4 @@ export const resetUserSecurityKeys: CommandModule<{}, ResetUserSecurityKeysArgs> process.exit(1); } } -}; \ No newline at end of file +}; diff --git a/cli/commands/setAdminCredentials.ts b/cli/commands/setAdminCredentials.ts index 72ff8bff..c45da602 100644 --- a/cli/commands/setAdminCredentials.ts +++ b/cli/commands/setAdminCredentials.ts @@ -32,7 +32,8 @@ export const setAdminCredentials: CommandModule<{}, SetAdminCredentialsArgs> = { }, handler: async (argv: { email: string; password: string }) => { try { - const { email, password } = argv; + let { email, password } = argv; + email = email.trim().toLowerCase(); const parsed = passwordSchema.safeParse(password);