misc: addressed review comments

This commit is contained in:
Sheen Capadngan
2024-11-21 02:37:56 +08:00
parent 0c3894496c
commit bce3f3d676
6 changed files with 36 additions and 30 deletions
@@ -249,7 +249,11 @@ export const DynamicSecretTotpSchema = z.discriminatedUnion("configType", [
}),
z.object({
configType: z.literal(TotpConfigType.MANUAL),
secret: z.string().min(1),
secret: z
.string()
.trim()
.min(1)
.transform((val) => val.replace(/\s+/g, "")),
period: z.number().optional(),
algorithm: z.nativeEnum(TotpAlgorithm).optional(),
digits: z.number().optional()