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,12 +6,15 @@ type ResetUserSecurityKeysArgs = {
|
||||||
email: string;
|
email: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const resetUserSecurityKeys: CommandModule<{}, ResetUserSecurityKeysArgs> = {
|
export const resetUserSecurityKeys: CommandModule<
|
||||||
|
{},
|
||||||
|
ResetUserSecurityKeysArgs
|
||||||
|
> = {
|
||||||
command: "reset-user-security-keys",
|
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) => {
|
builder: (yargs) => {
|
||||||
return yargs
|
return yargs.option("email", {
|
||||||
.option("email", {
|
|
||||||
type: "string",
|
type: "string",
|
||||||
demandOption: true,
|
demandOption: true,
|
||||||
describe: "User email address"
|
describe: "User email address"
|
||||||
|
@ -48,7 +51,9 @@ export const resetUserSecurityKeys: CommandModule<{}, ResetUserSecurityKeysArgs>
|
||||||
process.exit(0);
|
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
|
// Delete all security keys for the user
|
||||||
await db
|
await db
|
||||||
|
|
|
@ -32,7 +32,8 @@ export const setAdminCredentials: CommandModule<{}, SetAdminCredentialsArgs> = {
|
||||||
},
|
},
|
||||||
handler: async (argv: { email: string; password: string }) => {
|
handler: async (argv: { email: string; password: string }) => {
|
||||||
try {
|
try {
|
||||||
const { email, password } = argv;
|
let { email, password } = argv;
|
||||||
|
email = email.trim().toLowerCase();
|
||||||
|
|
||||||
const parsed = passwordSchema.safeParse(password);
|
const parsed = passwordSchema.safeParse(password);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue