From fa2798940983fba9e077b4ce6b5474fce21b05c8 Mon Sep 17 00:00:00 2001 From: Suryansh Pandey Date: Sat, 16 Nov 2024 19:09:13 +0530 Subject: [PATCH] Update credentials.mdx Added code for Express in Validating credentials. --- .../authentication/credentials.mdx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/pages/getting-started/authentication/credentials.mdx b/docs/pages/getting-started/authentication/credentials.mdx index a30b4fe5f0..2b340c435d 100644 --- a/docs/pages/getting-started/authentication/credentials.mdx +++ b/docs/pages/getting-started/authentication/credentials.mdx @@ -540,4 +540,20 @@ export const { handle } = SvelteKitAuth({ ``` + + + +```ts filename="./lib/zod.ts" +import { z } from "zod"; +export const signInSchema = z.object({ + email: z.string({ required_error: "Email is required" }) + .min(1, "Email is required") + .email("Invalid email"), + password: z.string({ required_error: "Password is required" }) + .min(1, "Password is required") + .min(8, "Password must be more than 8 characters") + .max(32, "Password must be less than 32 characters"), +}); +``` +