Migração completa para Logto - Remoção de Clerk finalizada

This commit is contained in:
2026-03-31 10:32:42 +00:00
parent 87a87ae228
commit 49538cfbd4
21 changed files with 371 additions and 688 deletions

View File

@@ -23,7 +23,7 @@ export const ProtectedRoute: React.FC<ProtectedRouteProps> = ({
requireEdit = false,
redirectTo = '/',
}) => {
const { appUser, isLoading, canEdit } = useAuth();
const { appUser, isLoading, canEdit, isSignedIn } = useAuth();
// Show loading state
if (isLoading) {
@@ -34,6 +34,11 @@ export const ProtectedRoute: React.FC<ProtectedRouteProps> = ({
);
}
// Check authentication
if (!isSignedIn) {
return <Navigate to="/login" replace />;
}
// Check role-based access
if (allowedRoles && appUser && !allowedRoles.includes(appUser.role)) {
return <Navigate to={redirectTo} replace />;