Skip to content

Commit

Permalink
Merge branch 'main' into magic-links
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmccannon authored Apr 2, 2024
2 parents b09beb6 + 17a902b commit 71e7c61
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 71e7c61

Please sign in to comment.