fix: improve auth store with user state and role validation

This commit is contained in:
zetaloop
2026-02-20 20:40:25 +08:00
parent 9267df9ea1
commit 6008aa9b04
4 changed files with 38 additions and 17 deletions
+2 -1
View File
@@ -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)
}