Skip to content

Commit

Permalink
Merge in 'release/8.0' changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnet-bot committed Nov 28, 2023
2 parents 8b3f533 + c909955 commit 548269e
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@
{
"condition": "(!UseProgramMain)",
"exclude": [
"BlazorWeb-CSharp/Program.Main.cs"
"BlazorWeb-CSharp/Program.Main.cs",
"BlazorWeb-CSharp.Client/Program.Main.cs"
]
},
{
"condition": "(UseProgramMain)",
"exclude": [
"BlazorWeb-CSharp/Program.cs"
"BlazorWeb-CSharp/Program.cs",
"BlazorWeb-CSharp.Client/Program.cs"
],
"rename": {
"Program.Main.cs": "Program.cs"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#if (IndividualLocalAuth)
using BlazorWeb_CSharp.Client;
using Microsoft.AspNetCore.Components.Authorization;
#endif
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

namespace BlazorWeb_CSharp.Client;

class Program
{
static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);

#if (IndividualLocalAuth)
builder.Services.AddAuthorizationCore();
builder.Services.AddCascadingAuthenticationState();
builder.Services.AddSingleton<AuthenticationStateProvider, PersistentAuthenticationStateProvider>();

#endif
await builder.Build().RunAsync();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@page "/Account/AccessDenied"

<PageTitle>Access denied</PageTitle>

<header>
<h1 class="text-danger">Access denied</h1>
<p class="text-danger">You do not have access to this resource.</p>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@
@*#if (!InteractiveAtRoot)
<HeadOutlet />
##elseif (IndividualLocalAuth)
<HeadOutlet @rendermode="@RenderModeForPage" />
<HeadOutlet @rendermode="RenderModeForPage" />
##elseif (UseServer && UseWebAssembly)
<HeadOutlet @rendermode="@InteractiveAuto" />
<HeadOutlet @rendermode="InteractiveAuto" />
##elseif (UseServer)
<HeadOutlet @rendermode="@InteractiveServer" />
<HeadOutlet @rendermode="InteractiveServer" />
##else
<HeadOutlet @rendermode="@InteractiveWebAssembly" />
<HeadOutlet @rendermode="InteractiveWebAssembly" />
##endif*@
</head>

<body>
@*#if (!InteractiveAtRoot)
<Routes />
##elseif (IndividualLocalAuth)
<Routes @rendermode="@RenderModeForPage" />
<Routes @rendermode="RenderModeForPage" />
##elseif (UseServer && UseWebAssembly)
<Routes @rendermode="@InteractiveAuto" />
<Routes @rendermode="InteractiveAuto" />
##elseif (UseServer)
<Routes @rendermode="@InteractiveServer" />
<Routes @rendermode="InteractiveServer" />
##else
<Routes @rendermode="@InteractiveWebAssembly" />
<Routes @rendermode="InteractiveWebAssembly" />
##endif*@
<script src="_framework/blazor.web.js"></script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
@using BlazorWeb_CSharp.Components.Account.Shared
##endif*@
@*#if (UseWebAssembly && !InteractiveAtRoot)
<Router AppAssembly="@typeof(Program).Assembly" AdditionalAssemblies="new[] { typeof(Client._Imports).Assembly }">
<Router AppAssembly="typeof(Program).Assembly" AdditionalAssemblies="new[] { typeof(Client._Imports).Assembly }">
##else
<Router AppAssembly="@typeof(Program).Assembly">
<Router AppAssembly="typeof(Program).Assembly">
##endif*@
<Found Context="routeData">
@*#if (IndividualLocalAuth)
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)">
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
##else
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
##endif*@
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ public static void Main(string[] args)
#else
app.MapRazorComponents<App>();
#endif
#if (UseWebAssembly && SampleContent)
.AddAdditionalAssemblies(typeof(Counter).Assembly);
#elif (UseWebAssembly)
#if (UseWebAssembly)
.AddAdditionalAssemblies(typeof(Client._Imports).Assembly);
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@
#else
app.MapRazorComponents<App>();
#endif
#if (UseWebAssembly && SampleContent)
.AddAdditionalAssemblies(typeof(Counter).Assembly);
#elif (UseWebAssembly)
#if (UseWebAssembly)
.AddAdditionalAssemblies(typeof(BlazorWeb_CSharp.Client._Imports).Assembly);
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@
"Components/Account/IdentityNoOpEmailSender.cs",
"Components/Account/IdentityRedirectManager.cs",
"Components/Account/IdentityUserAccessor.cs",
"Components/Account/Pages/AccessDenied.razor",
"Components/Account/Pages/ConfirmEmail.razor",
"Components/Account/Pages/ConfirmEmailChange.razor",
"Components/Account/Pages/ExternalLogin.razor",
Expand Down Expand Up @@ -642,6 +643,7 @@
"Components/Account/IdentityRedirectManager.cs",
"Components/Account/IdentityRevalidatingAuthenticationStateProvider.cs",
"Components/Account/IdentityUserAccessor.cs",
"Components/Account/Pages/AccessDenied.razor",
"Components/Account/Pages/ConfirmEmail.razor",
"Components/Account/Pages/ConfirmEmailChange.razor",
"Components/Account/Pages/ExternalLogin.razor",
Expand Down Expand Up @@ -718,6 +720,7 @@
"Components/Account/IdentityRedirectManager.cs",
"Components/Account/IdentityRevalidatingAuthenticationStateProvider.cs",
"Components/Account/IdentityUserAccessor.cs",
"Components/Account/Pages/AccessDenied.razor",
"Components/Account/Pages/ConfirmEmail.razor",
"Components/Account/Pages/ConfirmEmailChange.razor",
"Components/Account/Pages/ExternalLogin.razor",
Expand Down Expand Up @@ -836,6 +839,7 @@
"{ProjectName}/Components/Account/IdentityNoOpEmailSender.cs",
"{ProjectName}/Components/Account/IdentityRedirectManager.cs",
"{ProjectName}/Components/Account/IdentityUserAccessor.cs",
"{ProjectName}/Components/Account/Pages/AccessDenied.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmail.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmailChange.razor",
"{ProjectName}/Components/Account/Pages/ExternalLogin.razor",
Expand Down Expand Up @@ -953,6 +957,7 @@
"{ProjectName}/Components/Account/IdentityNoOpEmailSender.cs",
"{ProjectName}/Components/Account/IdentityRedirectManager.cs",
"{ProjectName}/Components/Account/IdentityUserAccessor.cs",
"{ProjectName}/Components/Account/Pages/AccessDenied.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmail.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmailChange.razor",
"{ProjectName}/Components/Account/Pages/ExternalLogin.razor",
Expand Down Expand Up @@ -1214,6 +1219,7 @@
"{ProjectName}/Components/Account/IdentityNoOpEmailSender.cs",
"{ProjectName}/Components/Account/IdentityRedirectManager.cs",
"{ProjectName}/Components/Account/IdentityUserAccessor.cs",
"{ProjectName}/Components/Account/Pages/AccessDenied.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmail.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmailChange.razor",
"{ProjectName}/Components/Account/Pages/ExternalLogin.razor",
Expand Down Expand Up @@ -1282,6 +1288,7 @@
"Components/Account/IdentityRedirectManager.cs",
"Components/Account/IdentityRevalidatingAuthenticationStateProvider.cs",
"Components/Account/IdentityUserAccessor.cs",
"Components/Account/Pages/AccessDenied.razor",
"Components/Account/Pages/ConfirmEmail.razor",
"Components/Account/Pages/ConfirmEmailChange.razor",
"Components/Account/Pages/ExternalLogin.razor",
Expand Down Expand Up @@ -1375,6 +1382,7 @@
"{ProjectName}/Components/Account/IdentityNoOpEmailSender.cs",
"{ProjectName}/Components/Account/IdentityRedirectManager.cs",
"{ProjectName}/Components/Account/IdentityUserAccessor.cs",
"{ProjectName}/Components/Account/Pages/AccessDenied.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmail.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmailChange.razor",
"{ProjectName}/Components/Account/Pages/ExternalLogin.razor",
Expand Down Expand Up @@ -1459,6 +1467,7 @@
"{ProjectName}/Components/Account/IdentityNoOpEmailSender.cs",
"{ProjectName}/Components/Account/IdentityRedirectManager.cs",
"{ProjectName}/Components/Account/IdentityUserAccessor.cs",
"{ProjectName}/Components/Account/Pages/AccessDenied.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmail.razor",
"{ProjectName}/Components/Account/Pages/ConfirmEmailChange.razor",
"{ProjectName}/Components/Account/Pages/ExternalLogin.razor",
Expand Down

0 comments on commit 548269e

Please sign in to comment.