mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-22 18:29:19 +02:00
make email lower case in pangctl reset password closes #1210
This commit is contained in:
parent
eeb1d4954d
commit
74d2527af5
2 changed files with 17 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue