Skip to content

Commit

Permalink
Fix ASP.NET Identity endpoints integration tests (#128)
Browse files Browse the repository at this point in the history
* Fix ASP.NET Identity integration tests

* refactor
  • Loading branch information
jonashendrickx authored Apr 2, 2024
1 parent faacb67 commit 17a902b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/Passwordless.AspNetCore/IdentityBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@ private static IServiceCollection AddPasswordlessCore(this IServiceCollection se
Action<PasswordlessAspNetCoreOptions> 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<PasswordlessAspNetCoreOptions>(options => options.SignInScheme = defaultScheme);
}

services.Configure(configure);
var optionsBuilder = services.AddOptions<PasswordlessAspNetCoreOptions>().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(_ => { });
Expand All @@ -69,7 +62,7 @@ private static IServiceCollection AddPasswordlessCore(this IServiceCollection se
options.ApiKey = aspNetCoreOptions.ApiKey;
});

return services;
return services.AddShared(userType, optionsBuilder, defaultScheme);
}

/// <summary>
Expand Down

0 comments on commit 17a902b

Please sign in to comment.