35 lines
704 B
TypeScript
35 lines
704 B
TypeScript
import { create } from 'zustand'
|
|
import { MOCK_MEMBER_ME } from '@/lib/mock-data'
|
|
|
|
interface Session {
|
|
user: { id: string; email: string; name: string }
|
|
}
|
|
|
|
interface AuthState {
|
|
session: Session | null
|
|
isInitialized: boolean
|
|
initialize: () => Promise<void>
|
|
signOut: () => Promise<void>
|
|
}
|
|
|
|
export const useAuthStore = create<AuthState>((set) => ({
|
|
// Mock: direkt eingeloggt
|
|
session: {
|
|
user: {
|
|
id: MOCK_MEMBER_ME.userId!,
|
|
email: MOCK_MEMBER_ME.email,
|
|
name: MOCK_MEMBER_ME.name,
|
|
},
|
|
},
|
|
isInitialized: true,
|
|
|
|
initialize: async () => {
|
|
// Mock: nichts zu tun
|
|
set({ isInitialized: true })
|
|
},
|
|
|
|
signOut: async () => {
|
|
set({ session: null })
|
|
},
|
|
}))
|