mirror of
https://github.com/Sosokker/go-chi-oapi-codegen-todolist.git
synced 2025-12-19 05:54:07 +01:00
18 lines
388 B
TypeScript
18 lines
388 B
TypeScript
"use client"
|
|
|
|
import type React from "react"
|
|
|
|
import { useEffect } from "react"
|
|
import { useAuthStore } from "./auth-store"
|
|
|
|
export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
const { initialize } = useAuthStore()
|
|
|
|
useEffect(() => {
|
|
// Initialize auth state from localStorage (if available)
|
|
initialize()
|
|
}, [initialize])
|
|
|
|
return <>{children}</>
|
|
}
|