feat(auth): add role guards and protect admin routes
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const signInSchema = z.object({
|
||||
username: z
|
||||
.string()
|
||||
.min(1, {
|
||||
error: "Invalid username",
|
||||
})
|
||||
.nonempty("Username is required"),
|
||||
password: z
|
||||
.string()
|
||||
.min(3, {
|
||||
error: "Password is too short",
|
||||
})
|
||||
.nonempty("Password is required"),
|
||||
})
|
||||
|
||||
export type SignInFormType = z.infer<typeof signInSchema>
|
||||
Reference in New Issue
Block a user