From 17a902b80f4cdcd8d33e14554fa0649aca428e2e Mon Sep 17 00:00:00 2001 From: Jonas Hendrickx Date: Tue, 2 Apr 2024 17:02:18 +0200 Subject: [PATCH] Fix ASP.NET Identity endpoints integration tests (#128) * Fix ASP.NET Identity integration tests * refactor --- .../IdentityBuilderExtensions.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Passwordless.AspNetCore/IdentityBuilderExtensions.cs b/src/Passwordless.AspNetCore/IdentityBuilderExtensions.cs index fef215e..6798974 100644 --- a/src/Passwordless.AspNetCore/IdentityBuilderExtensions.cs +++ b/src/Passwordless.AspNetCore/IdentityBuilderExtensions.cs @@ -47,14 +47,7 @@ private static IServiceCollection AddPasswordlessCore(this IServiceCollection se Action configure, string? defaultScheme) { - // If a default scheme was passed in (ASP.NET Identity in use) then configure our option to take that one - // but still call their configure callback after so they have the opportunity to override it. - if (!string.IsNullOrEmpty(defaultScheme)) - { - services.Configure(options => options.SignInScheme = defaultScheme); - } - - services.Configure(configure); + var optionsBuilder = services.AddOptions().Configure(configure); // Add the SDK services but don't configure it there since ASP.NET Core options are a superset of their options. services.AddPasswordlessSdk(_ => { }); @@ -69,7 +62,7 @@ private static IServiceCollection AddPasswordlessCore(this IServiceCollection se options.ApiKey = aspNetCoreOptions.ApiKey; }); - return services; + return services.AddShared(userType, optionsBuilder, defaultScheme); } ///