phase1: RLS simplified to tenant isolation only + canAccess fallback removed + useUserPermissions hook + security kernel docs
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import { useCurrentUser } from '@/api/hooks';
|
||||
import { useUserPermissions } from '@/hooks/useUserPermissions';
|
||||
|
||||
export function useAuth() {
|
||||
const store = useAuthStore();
|
||||
const { data, isLoading, isError, error } = useCurrentUser();
|
||||
|
||||
// Load permissions after authentication
|
||||
useUserPermissions();
|
||||
|
||||
useEffect(() => {
|
||||
if (isError) {
|
||||
const status = (error as any)?.status || 0;
|
||||
|
||||
Reference in New Issue
Block a user