Skip to content

Commit 2af81a0

Browse files
committed
Small fixes
1 parent 64c9fbb commit 2af81a0

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/Pages/Auth.razor

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
@using Microsoft.AspNetCore.Authorization;
44

55
@attribute [Authorize]
6-
@attribute [RenderModeAuto]
6+
@*#if (UseServer && !InteractiveAtRoot)
7+
@attribute [RenderModeInteractiveAuto]
8+
##elseif (!InteractiveAtRoot)
9+
@attribute [RenderModeInteractiveWebAssembly]
10+
##endif*@
711

812
<PageTitle>Auth</PageTitle>
913

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp.Client/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#if (IndividualLocalAuth)
1010
builder.Services.AddAuthorizationCore();
1111
builder.Services.AddCascadingAuthenticationState();
12-
builder.Services.AddSingleton<AuthenticationStateProvider, PersistedAuthenticationStateProvider>();
12+
builder.Services.AddSingleton<AuthenticationStateProvider, PersistentAuthenticationStateProvider>();
1313

1414
#endif
1515
await builder.Build().RunAsync();

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Pages/Account/LoginWith2fa.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</div>
4343
<p>
4444
Don't have access to your authenticator device? You can
45-
<a id="recovery-code-login" href="/Account/LoginWithRecoveryCode?ReturnUrl=@HtmlEncoder.Default.Encode(ReturnUrl)">log in with a recovery code</a>.
45+
<a id="recovery-code-login" href="/Account/LoginWithRecoveryCode?ReturnUrl=@HtmlEncoder.Default.Encode(ReturnUrl ?? "/")">log in with a recovery code</a>.
4646
</p>
4747

4848
@code {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@using BlazorWeb_CSharp.Components.Identity

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Identity/Extensions/IdentityComponentsEndpointRouteBuilderExtensions.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public static IEndpointConventionBuilder MapAdditionalIdentityEndpoints(this IEn
1818
{
1919
ArgumentNullException.ThrowIfNull(endpoints);
2020

21-
var logger = endpoints.ServiceProvider.GetRequiredService<ILogger<IdentityComponentsEndpointRouteBuilderExtensions>>();
21+
var loggerFactory = endpoints.ServiceProvider.GetRequiredService<ILoggerFactory>();
22+
var logger = loggerFactory.CreateLogger("IdentityUI");
2223
var accountGroup = endpoints.MapGroup("/Account");
2324

2425
accountGroup.MapPost("/PerformExternalLogin", (
@@ -35,7 +36,7 @@ public static IEndpointConventionBuilder MapAdditionalIdentityEndpoints(this IEn
3536
context.Request.PathBase,
3637
$"/Account/ExternalLogin",
3738
QueryString.Create(query));
38-
39+
3940
var properties = signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl);
4041
return Results.Challenge(properties, [provider]);
4142
});
@@ -72,7 +73,7 @@ public static IEndpointConventionBuilder MapAdditionalIdentityEndpoints(this IEn
7273
context.Request.PathBase,
7374
$"/Account/Manage/ExternalLogins",
7475
QueryString.Create("Action", ExternalLogins.LinkLoginCallbackAction));
75-
76+
7677
var properties = signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, signInManager.UserManager.GetUserId(context.User));
7778
return Results.Challenge(properties, [provider]);
7879
});

0 commit comments

Comments
 (0)