This commit is contained in:
2025-12-23 19:26:23 +01:00
commit da7e984965
94 changed files with 26350 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import type { AuthConfig, Flash, User } from '@/types'
import { usePage } from '@inertiajs/vue3'
import { computed } from 'vue'
export function useAuth() {
const page = usePage<{
auth: { user: User | null }
flash: Flash
authConfig: AuthConfig
}>()
const user = computed(() => page.props.auth.user)
const isAuthenticated = computed(() => !!page.props.auth.user)
const flash = computed(() => page.props.flash)
const config = computed(() => page.props.authConfig)
return {
user,
isAuthenticated,
flash,
config,
}
}