stadtwerke/innungsapp/apps/mobile/hooks/useAuth.ts

22 lines
471 B
TypeScript

import { useAuthStore } from '@/store/auth.store'
import { useRouter } from 'expo-router'
export function useAuth() {
const { session, signOut } = useAuthStore()
const router = useRouter()
async function handleSignOut() {
await signOut()
router.replace('/(auth)/login')
}
return {
session,
orgId: 'org-1',
role: 'member' as const,
isAuthenticated: true, // Mock: immer eingeloggt
isAdmin: false,
signOut: handleSignOut,
}
}