fix: improve auth store with user state and role validation
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
} from "@/components/ui/dialog"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { currentUser } from "@/lib/mock-data"
|
||||
import { useAuthStore } from "@/store/auth"
|
||||
|
||||
const loginSchema = z.object({
|
||||
@@ -39,7 +40,7 @@ export function LoginDialog({ open, onOpenChange }: LoginDialogProps) {
|
||||
|
||||
const onSubmit = async (_data: z.infer<typeof loginSchema>) => {
|
||||
await new Promise((r) => setTimeout(r, 500))
|
||||
login()
|
||||
login(currentUser, ["consumer", "player", "owner"])
|
||||
onOpenChange(false)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user