Skip to content

Instantly share code, notes, and snippets.

@pazteddy
Created October 1, 2025 23:32
Show Gist options
  • Select an option

  • Save pazteddy/1a4d1278b1ff5c9dc8876ce3be773bf6 to your computer and use it in GitHub Desktop.

Select an option

Save pazteddy/1a4d1278b1ff5c9dc8876ce3be773bf6 to your computer and use it in GitHub Desktop.
Estilos para mostrar un mensaje en caso de que no se cuente con la autorización necesaria
<Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="routeData"
DefaultLayout="typeof(Shared.NoteLayout)">
<NotAuthorized>
<div class="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
<div class="max-w-md w-full space-y-8">
<div class="text-center">
<!-- Icono de acceso denegado -->
<svg class="mx-auto h-24 w-24 text-red-400" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
</svg>
<!-- Título -->
<h2 class="mt-6 text-3xl font-extrabold text-gray-900">
Acceso Denegado
</h2>
<!-- Mensaje -->
<p class="mt-2 text-sm text-gray-600">
No tienes permisos para acceder a esta página.
<br />
Por favor, inicia sesión para continuar.
</p>
</div>
<!-- Botones de acción -->
<div class="mt-8 space-y-4">
<a href="/login"
class="group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition duration-150 ease-in-out">
Iniciar Sesión
</a>
<a href="/notes"
class="group relative w-full flex justify-center py-3 px-4 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition duration-150 ease-in-out">
Volver a notas
</a>
</div>
</div>
</div>
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment