From ec51892164be7e95fe1e6809ba90e5399319a1e0 Mon Sep 17 00:00:00 2001 From: Foxocube Date: Thu, 9 Jan 2025 21:01:14 +0000 Subject: [PATCH] Try different method of fixing login --- .../IdentityComponentsEndpointRouteBuilderExtensions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MediaFeeder/MediaFeeder/Components/Account/IdentityComponentsEndpointRouteBuilderExtensions.cs b/MediaFeeder/MediaFeeder/Components/Account/IdentityComponentsEndpointRouteBuilderExtensions.cs index 2bd0293..4ce3889 100644 --- a/MediaFeeder/MediaFeeder/Components/Account/IdentityComponentsEndpointRouteBuilderExtensions.cs +++ b/MediaFeeder/MediaFeeder/Components/Account/IdentityComponentsEndpointRouteBuilderExtensions.cs @@ -21,7 +21,7 @@ public static IEndpointConventionBuilder MapAdditionalIdentityEndpoints(this IEn var accountGroup = endpoints.MapGroup("/Account"); - accountGroup.MapGet("/PerformExternalLogin/{provider}", [AllowAnonymous] static ( + accountGroup.MapGet("/PerformExternalLogin/{provider}", static ( HttpContext context, [FromServices] SignInManager signInManager, [FromRoute] string provider, @@ -40,9 +40,9 @@ public static IEndpointConventionBuilder MapAdditionalIdentityEndpoints(this IEn var properties = signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); return TypedResults.Challenge(properties, [provider]); - }); + }).AllowAnonymous(); - accountGroup.MapPost("/PerformExternalLogin", [AllowAnonymous] static ( + accountGroup.MapPost("/PerformExternalLogin", static ( HttpContext context, [FromServices] SignInManager signInManager, [FromForm] string provider, @@ -61,7 +61,7 @@ public static IEndpointConventionBuilder MapAdditionalIdentityEndpoints(this IEn var properties = signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); return TypedResults.Challenge(properties, [provider]); - }); + }).AllowAnonymous(); accountGroup.MapPost("/Logout", static async ( [FromServices] SignInManager signInManager,