Skip to content

Commit

Permalink
Add AccessDenied page
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Oct 29, 2023
1 parent 930b981 commit d86117b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
6 changes: 5 additions & 1 deletion MyApp/Components/Shared/Header.razor
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@
<li class="relative flex flex-wrap just-fu-start m-0">
<NavLink href="videos" class="p-4 flex items-center justify-start mw-full hover:text-sky-500 dark:hover:text-sky-400" ActiveClass="text-blue-700 dark:text-blue-300">Videos</NavLink>
</li>
<AuthorizeView>
<AuthorizeView Roles="Admin">
<Authorized>
<li class="relative flex flex-wrap just-fu-start m-0">
<NavLink href="admin/" class="p-4 flex items-center justify-start mw-full hover:text-sky-500 dark:hover:text-sky-400" ActiveClass="text-blue-700 dark:text-blue-300">Admin</NavLink>
</li>
</Authorized>
</AuthorizeView>
<AuthorizeView>
<Authorized>
<li>
<div class="mx-3 relative">
<div>
Expand Down
16 changes: 16 additions & 0 deletions MyApp/Pages/Account/AccessDenied.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@page "/Account/AccessDenied"


<PageTitle>Access Denied</PageTitle>

<div class="mt-8 mx-auto max-w-lg">
<h1 class="text-3xl font-bold tracking-tight sm:text-4xl text-danger">Access Denied</h1>

<p class="my-4 text-danger">
You do not have access to this resource.
</p>
</div>

@code {
[Parameter] public string ReturnUrl { get; set; }
}
14 changes: 13 additions & 1 deletion MyApp/wwwroot/css/app.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com
! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com
*/

/*
Expand Down Expand Up @@ -191,6 +191,10 @@ select,
textarea {
font-family: inherit;
/* 1 */
font-feature-settings: inherit;
/* 1 */
font-variation-settings: inherit;
/* 1 */
font-size: 100%;
/* 1 */
font-weight: inherit;
Expand Down Expand Up @@ -341,6 +345,14 @@ menu {
padding: 0;
}

/*
Reset default styling for dialogs.
*/

dialog {
padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/
Expand Down

0 comments on commit d86117b

Please sign in to comment.