feat: additional valid password (#1456)
This commit is contained in:
@@ -2,7 +2,7 @@ import cors from '@/lib/cors';
|
|||||||
import { getUserMonthlyGrowth } from '@/lib/growth/get-user-monthly-growth';
|
import { getUserMonthlyGrowth } from '@/lib/growth/get-user-monthly-growth';
|
||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
const totalUsers = await getUserMonthlyGrowth("cumulative");
|
const totalUsers = await getUserMonthlyGrowth('cumulative');
|
||||||
|
|
||||||
return cors(
|
return cors(
|
||||||
request,
|
request,
|
||||||
|
|||||||
@@ -47,10 +47,7 @@ export const StackAvatar = ({ first, zIndex, fallbackText = '', type }: StackAva
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Avatar
|
<Avatar
|
||||||
className={`
|
className={` ${zIndexClass} ${firstClass} dark:border-border h-10 w-10 border-2 border-solid border-white`}
|
||||||
${zIndexClass}
|
|
||||||
${firstClass}
|
|
||||||
dark:border-border h-10 w-10 border-2 border-solid border-white`}
|
|
||||||
>
|
>
|
||||||
<AvatarFallback className={classes}>{fallbackText}</AvatarFallback>
|
<AvatarFallback className={classes}>{fallbackText}</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export const ZSignUpFormV2Schema = z
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: msg`Password should not be common or based on personal information`.id,
|
message: msg`Password should not be common or based on personal information`.id,
|
||||||
|
path: ['password'],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,20 @@ export const ZCurrentPasswordSchema = z
|
|||||||
|
|
||||||
export const ZPasswordSchema = z
|
export const ZPasswordSchema = z
|
||||||
.string()
|
.string()
|
||||||
.regex(new RegExp('.*[A-Z].*'), { message: 'One uppercase character' })
|
|
||||||
.regex(new RegExp('.*[a-z].*'), { message: 'One lowercase character' })
|
|
||||||
.regex(new RegExp('.*\\d.*'), { message: 'One number' })
|
|
||||||
.regex(new RegExp('.*[`~<>?,./!@#$%^&*()\\-_+="\'|{}\\[\\];:\\\\].*'), {
|
|
||||||
message: 'One special character is required',
|
|
||||||
})
|
|
||||||
.min(8, { message: 'Must be at least 8 characters in length' })
|
.min(8, { message: 'Must be at least 8 characters in length' })
|
||||||
.max(72, { message: 'Cannot be more than 72 characters in length' });
|
.max(72, { message: 'Cannot be more than 72 characters in length' })
|
||||||
|
.refine((value) => value.length > 25 || /[A-Z]/.test(value), {
|
||||||
|
message: 'One uppercase character',
|
||||||
|
})
|
||||||
|
.refine((value) => value.length > 25 || /[a-z]/.test(value), {
|
||||||
|
message: 'One lowercase character',
|
||||||
|
})
|
||||||
|
.refine((value) => value.length > 25 || /\d/.test(value), {
|
||||||
|
message: 'One number',
|
||||||
|
})
|
||||||
|
.refine((value) => value.length > 25 || /[`~<>?,./!@#$%^&*()\-_"'+=|{}[\];:\\]/.test(value), {
|
||||||
|
message: 'One special character is required',
|
||||||
|
});
|
||||||
|
|
||||||
export const ZSignUpMutationSchema = z.object({
|
export const ZSignUpMutationSchema = z.object({
|
||||||
name: z.string().min(1),
|
name: z.string().min(1),
|
||||||
|
|||||||
Reference in New Issue
Block a user