Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Nov 15, 2024
1 parent edc2305 commit ec9500d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@

<PageTitle>@Localizer[nameof(AppStrings.NotAuthorizedPageTitle)]</PageTitle>

<AuthorizeView>
<section>
<BitStack HorizontalAlign="BitAlignment.Center">
<BitImage Src="_content/Boilerplate.Client.Core/images/403.svg" Width="100%" Style="max-width:600px" />

<BitText Typography="BitTypography.H5" Color="BitColor.SevereWarning" Align="BitTextAlign.Center">
@Localizer[nameof(AppStrings.ForbiddenException)]
</BitText>
@if (isRefreshingToken)
{
<LoadingComponent />
}
else
{
<AuthorizeView>
<section>
<BitStack HorizontalAlign="BitAlignment.Center">
<BitImage Src="_content/Boilerplate.Client.Core/images/403.svg" Width="100%" Style="max-width:600px" />

<BitText>@Localizer[nameof(AppStrings.YouAreSignInAs)] <b>@user.GetDisplayName()</b></BitText>
<BitText Typography="BitTypography.H5" Color="BitColor.SevereWarning" Align="BitTextAlign.Center">
@Localizer[nameof(AppStrings.ForbiddenException)]
</BitText>

<BitButton OnClick="WrapHandled(SignIn)">@Localizer[nameof(AppStrings.SignInAsDifferentUser)]</BitButton>
</BitStack>
</section>
</AuthorizeView>
<BitText>@Localizer[nameof(AppStrings.YouAreSignInAs)] <b>@user.GetDisplayName()</b></BitText>

@if (isRefreshingToken)
{
<LoadingComponent FullScreen />
<BitButton OnClick="WrapHandled(SignIn)">@Localizer[nameof(AppStrings.SignInAsDifferentUser)]</BitButton>
</BitStack>
</section>
</AuthorizeView>
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ protected override async Task OnAfterFirstRenderAsync()
if (string.IsNullOrEmpty(refresh_token) is false && ReturnUrl?.Contains("try_refreshing_token=false", StringComparison.InvariantCulture) is null or false)
{
isRefreshingToken = true;
StateHasChanged();
try
{
await AuthenticationManager.RefreshToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AppRouteDataPublisher RouteData="@routeData" />
<AuthorizeRouteView RouteData="@routeData">
<Authorizing>
<LoadingComponent FullScreen />
<LoadingComponent />
</Authorizing>
<NotAuthorized>
<NotAuthorizedPage />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
namespace Boilerplate.Client.Core.Services.HttpMessageHandlers;

public partial class AuthDelegatingHandler(IJSRuntime jsRuntime,
IConfiguration configuration,
IStorageService storageService,
IServiceProvider serviceProvider,
IAuthTokenProvider tokenProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
//#endif
//#if (notification == true)
using Boilerplate.Shared.Dtos.PushNotification;
//#endif
using Boilerplate.Shared.Dtos.Home;
//#endif

namespace Boilerplate.Shared.Dtos;

Expand Down

0 comments on commit ec9500d

Please sign in to comment.