Skip to content

Fix ASP.NET Identity endpoints integration tests #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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