Skip to content

Commit

Permalink
Try different method of fixing login
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxocube committed Jan 9, 2025
1 parent 77cbdbc commit ec51892
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<AuthUser> signInManager,
[FromRoute] string provider,
Expand All @@ -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<AuthUser> signInManager,
[FromForm] string provider,
Expand All @@ -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<AuthUser> signInManager,
Expand Down

0 comments on commit ec51892

Please sign in to comment.