Skip to content

Commit 118a717

Browse files
committed
React to API review feedback
1 parent 439fd5a commit 118a717

23 files changed

+139
-86
lines changed

src/Identity/Core/src/IEmailSender.cs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,4 @@ public interface IEmailSender
1818
/// <param name="htmlMessage">The body of the email which may contain HTML tags. Do not double encode this.</param>
1919
/// <returns></returns>
2020
Task SendEmailAsync(string email, string subject, string htmlMessage);
21-
22-
/// <summary>
23-
/// This API supports the ASP.NET Core Identity infrastructure and is not intended to be used as a general purpose
24-
/// email abstraction. It should be implemented by the application so the Identity infrastructure can send confirmation emails.
25-
/// </summary>
26-
/// <param name="user">The user that is attempting to confirm their email.</param>
27-
/// <param name="email">The recipient's email address.</param>
28-
/// <param name="confirmationLink">The link to follow to confirm a user's email. Do not double encode this.</param>
29-
/// <returns></returns>
30-
Task SendConfirmationLinkAsync<TUser>(TUser user, string email, string confirmationLink) where TUser : class
31-
{
32-
return SendEmailAsync(email, "Confirm your email", $"Please confirm your account by <a href='{confirmationLink}'>clicking here</a>.");
33-
}
34-
35-
/// <summary>
36-
/// This API supports the ASP.NET Core Identity infrastructure and is not intended to be used as a general purpose
37-
/// email abstraction. It should be implemented by the application so the Identity infrastructure can send password reset emails.
38-
/// </summary>
39-
/// <param name="user">The user that is attempting to reset their password.</param>
40-
/// <param name="email">The recipient's email address.</param>
41-
/// <param name="resetLink">The link to follow to reset the user password. Do not double encode this.</param>
42-
/// <returns></returns>
43-
Task SendPasswordResetLinkAsync<TUser>(TUser user, string email, string resetLink) where TUser : class
44-
{
45-
return SendEmailAsync(email, "Reset your password", $"Please reset your password by <a href='{resetLink}'>clicking here</a>.");
46-
}
47-
48-
/// <summary>
49-
/// This API supports the ASP.NET Core Identity infrastructure and is not intended to be used as a general purpose
50-
/// email abstraction. It should be implemented by the application so the Identity infrastructure can send password reset emails.
51-
/// </summary>
52-
/// <param name="user">The user that is attempting to reset their password.</param>
53-
/// <param name="email">The recipient's email address.</param>
54-
/// <param name="resetCode">The code to use to reset the user password. Do not double encode this.</param>
55-
/// <returns></returns>
56-
Task SendPasswordResetCodeAsync<TUser>(TUser user, string email, string resetCode) where TUser : class
57-
{
58-
return SendEmailAsync(email, "Reset your password", $"Please reset your password using the following code: {resetCode}");
59-
}
6021
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
namespace Microsoft.AspNetCore.Identity;
5+
6+
/// <summary>
7+
/// This API supports the ASP.NET Core Identity infrastructure and is not intended to be used as a general purpose
8+
/// email abstraction. It should be implemented by the application so the Identity infrastructure can send confirmation and password reset emails.
9+
/// </summary>
10+
public interface IEmailSender<TUser> where TUser : class
11+
{
12+
/// <summary>
13+
/// This API supports the ASP.NET Core Identity infrastructure and is not intended to be used as a general purpose
14+
/// email abstraction. It should be implemented by the application so the Identity infrastructure can send confirmation emails.
15+
/// </summary>
16+
/// <param name="user">The user that is attempting to confirm their email.</param>
17+
/// <param name="email">The recipient's email address.</param>
18+
/// <param name="confirmationLink">The link to follow to confirm a user's email. Do not double encode this.</param>
19+
/// <returns></returns>
20+
Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink);
21+
22+
/// <summary>
23+
/// This API supports the ASP.NET Core Identity infrastructure and is not intended to be used as a general purpose
24+
/// email abstraction. It should be implemented by the application so the Identity infrastructure can send password reset emails.
25+
/// </summary>
26+
/// <param name="user">The user that is attempting to reset their password.</param>
27+
/// <param name="email">The recipient's email address.</param>
28+
/// <param name="resetLink">The link to follow to reset the user password. Do not double encode this.</param>
29+
/// <returns></returns>
30+
Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink);
31+
32+
/// <summary>
33+
/// This API supports the ASP.NET Core Identity infrastructure and is not intended to be used as a general purpose
34+
/// email abstraction. It should be implemented by the application so the Identity infrastructure can send password reset emails.
35+
/// </summary>
36+
/// <param name="user">The user that is attempting to reset their password.</param>
37+
/// <param name="email">The recipient's email address.</param>
38+
/// <param name="resetCode">The code to use to reset the user password. Do not double encode this.</param>
39+
/// <returns></returns>
40+
Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode);
41+
}

src/Identity/Core/src/IdentityApiEndpointRouteBuilderExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using Microsoft.AspNetCore.Http.Metadata;
1515
using Microsoft.AspNetCore.Identity;
1616
using Microsoft.AspNetCore.Identity.Data;
17-
using Microsoft.AspNetCore.Identity.UI.Services;
1817
using Microsoft.AspNetCore.WebUtilities;
1918
using Microsoft.Extensions.DependencyInjection;
2019
using Microsoft.Extensions.Options;
@@ -45,7 +44,7 @@ public static IEndpointConventionBuilder MapIdentityApi<TUser>(this IEndpointRou
4544

4645
var timeProvider = endpoints.ServiceProvider.GetRequiredService<TimeProvider>();
4746
var bearerTokenOptions = endpoints.ServiceProvider.GetRequiredService<IOptionsMonitor<BearerTokenOptions>>();
48-
var emailSender = endpoints.ServiceProvider.GetRequiredService<IEmailSender>();
47+
var emailSender = endpoints.ServiceProvider.GetRequiredService<IEmailSender<TUser>>();
4948
var linkGenerator = endpoints.ServiceProvider.GetRequiredService<LinkGenerator>();
5049

5150
// We'll figure out a unique endpoint name based on the final route pattern during endpoint generation.

src/Identity/Core/src/IdentityBuilderExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public static IdentityBuilder AddApiEndpoints(this IdentityBuilder builder)
9797

9898
builder.AddSignInManager();
9999
builder.AddDefaultTokenProviders();
100+
builder.Services.TryAddTransient(typeof(IEmailSender<>), typeof(DefaultMessageEmailSender<>));
100101
builder.Services.TryAddTransient<IEmailSender, NoOpEmailSender>();
101102
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JsonOptions>, IdentityEndpointsJsonOptionsSetup>());
102103
return builder;

src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<Compile Include="$(SharedSourceRoot)BearerToken\DTO\*.cs" LinkBase="DTO" />
16+
<Compile Include="$(SharedSourceRoot)DefaultMessageEmailSender.cs" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

src/Identity/Core/src/PublicAPI.Unshipped.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ Microsoft.AspNetCore.Identity.Data.TwoFactorResponse.RecoveryCodesLeft.init -> v
7575
Microsoft.AspNetCore.Identity.Data.TwoFactorResponse.SharedKey.get -> string!
7676
Microsoft.AspNetCore.Identity.Data.TwoFactorResponse.SharedKey.init -> void
7777
Microsoft.AspNetCore.Identity.Data.TwoFactorResponse.TwoFactorResponse() -> void
78+
Microsoft.AspNetCore.Identity.IEmailSender<TUser>
79+
Microsoft.AspNetCore.Identity.IEmailSender<TUser>.SendConfirmationLinkAsync(TUser! user, string! email, string! confirmationLink) -> System.Threading.Tasks.Task!
80+
Microsoft.AspNetCore.Identity.IEmailSender<TUser>.SendPasswordResetCodeAsync(TUser! user, string! email, string! resetCode) -> System.Threading.Tasks.Task!
81+
Microsoft.AspNetCore.Identity.IEmailSender<TUser>.SendPasswordResetLinkAsync(TUser! user, string! email, string! resetLink) -> System.Threading.Tasks.Task!
7882
Microsoft.AspNetCore.Identity.SecurityStampValidator<TUser>.SecurityStampValidator(Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Identity.SecurityStampValidatorOptions!>! options, Microsoft.AspNetCore.Identity.SignInManager<TUser!>! signInManager, Microsoft.Extensions.Logging.ILoggerFactory! logger) -> void
7983
Microsoft.AspNetCore.Identity.SecurityStampValidator<TUser>.TimeProvider.get -> System.TimeProvider!
8084
Microsoft.AspNetCore.Identity.SecurityStampValidatorOptions.TimeProvider.get -> System.TimeProvider?
@@ -83,10 +87,7 @@ Microsoft.AspNetCore.Identity.SignInManager<TUser>.AuthenticationScheme.get -> s
8387
Microsoft.AspNetCore.Identity.SignInManager<TUser>.AuthenticationScheme.set -> void
8488
Microsoft.AspNetCore.Identity.TwoFactorSecurityStampValidator<TUser>.TwoFactorSecurityStampValidator(Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Identity.SecurityStampValidatorOptions!>! options, Microsoft.AspNetCore.Identity.SignInManager<TUser!>! signInManager, Microsoft.Extensions.Logging.ILoggerFactory! logger) -> void
8589
Microsoft.AspNetCore.Identity.UI.Services.IEmailSender
86-
Microsoft.AspNetCore.Identity.UI.Services.IEmailSender.SendConfirmationLinkAsync<TUser>(TUser! user, string! email, string! confirmationLink) -> System.Threading.Tasks.Task!
8790
Microsoft.AspNetCore.Identity.UI.Services.IEmailSender.SendEmailAsync(string! email, string! subject, string! htmlMessage) -> System.Threading.Tasks.Task!
88-
Microsoft.AspNetCore.Identity.UI.Services.IEmailSender.SendPasswordResetCodeAsync<TUser>(TUser! user, string! email, string! resetCode) -> System.Threading.Tasks.Task!
89-
Microsoft.AspNetCore.Identity.UI.Services.IEmailSender.SendPasswordResetLinkAsync<TUser>(TUser! user, string! email, string! resetLink) -> System.Threading.Tasks.Task!
9091
Microsoft.AspNetCore.Identity.UI.Services.NoOpEmailSender
9192
Microsoft.AspNetCore.Identity.UI.Services.NoOpEmailSender.NoOpEmailSender() -> void
9293
Microsoft.AspNetCore.Identity.UI.Services.NoOpEmailSender.SendEmailAsync(string! email, string! subject, string! htmlMessage) -> System.Threading.Tasks.Task!

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Text;
88
using System.Text.Encodings.Web;
99
using Microsoft.AspNetCore.Authorization;
10-
using Microsoft.AspNetCore.Identity.UI.Services;
1110
using Microsoft.AspNetCore.Mvc;
1211
using Microsoft.AspNetCore.Mvc.RazorPages;
1312
using Microsoft.AspNetCore.WebUtilities;
@@ -95,15 +94,15 @@ internal sealed class ExternalLoginModel<TUser> : ExternalLoginModel where TUser
9594
private readonly UserManager<TUser> _userManager;
9695
private readonly IUserStore<TUser> _userStore;
9796
private readonly IUserEmailStore<TUser> _emailStore;
98-
private readonly IEmailSender _emailSender;
97+
private readonly IEmailSender<TUser> _emailSender;
9998
private readonly ILogger<ExternalLoginModel> _logger;
10099

101100
public ExternalLoginModel(
102101
SignInManager<TUser> signInManager,
103102
UserManager<TUser> userManager,
104103
IUserStore<TUser> userStore,
105104
ILogger<ExternalLoginModel> logger,
106-
IEmailSender emailSender)
105+
IEmailSender<TUser> emailSender)
107106
{
108107
_signInManager = signInManager;
109108
_userManager = userManager;

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ForgotPassword.cshtml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Text;
66
using System.Text.Encodings.Web;
77
using Microsoft.AspNetCore.Authorization;
8-
using Microsoft.AspNetCore.Identity.UI.Services;
98
using Microsoft.AspNetCore.Mvc;
109
using Microsoft.AspNetCore.Mvc.RazorPages;
1110
using Microsoft.AspNetCore.WebUtilities;
@@ -52,9 +51,9 @@ public class InputModel
5251
internal sealed class ForgotPasswordModel<TUser> : ForgotPasswordModel where TUser : class
5352
{
5453
private readonly UserManager<TUser> _userManager;
55-
private readonly IEmailSender _emailSender;
54+
private readonly IEmailSender<TUser> _emailSender;
5655

57-
public ForgotPasswordModel(UserManager<TUser> userManager, IEmailSender emailSender)
56+
public ForgotPasswordModel(UserManager<TUser> userManager, IEmailSender<TUser> emailSender)
5857
{
5958
_userManager = userManager;
6059
_emailSender = emailSender;

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/Email.cshtml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.ComponentModel.DataAnnotations;
55
using System.Text;
66
using System.Text.Encodings.Web;
7-
using Microsoft.AspNetCore.Identity.UI.Services;
87
using Microsoft.AspNetCore.Mvc;
98
using Microsoft.AspNetCore.Mvc.RazorPages;
109
using Microsoft.AspNetCore.WebUtilities;
@@ -83,12 +82,12 @@ internal sealed class EmailModel<TUser> : EmailModel where TUser : class
8382
{
8483
private readonly UserManager<TUser> _userManager;
8584
private readonly SignInManager<TUser> _signInManager;
86-
private readonly IEmailSender _emailSender;
85+
private readonly IEmailSender<TUser> _emailSender;
8786

8887
public EmailModel(
8988
UserManager<TUser> userManager,
9089
SignInManager<TUser> signInManager,
91-
IEmailSender emailSender)
90+
IEmailSender<TUser> emailSender)
9291
{
9392
_userManager = userManager;
9493
_signInManager = signInManager;

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Register.cshtml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Text.Encodings.Web;
99
using Microsoft.AspNetCore.Authentication;
1010
using Microsoft.AspNetCore.Authorization;
11-
using Microsoft.AspNetCore.Identity.UI.Services;
1211
using Microsoft.AspNetCore.Mvc;
1312
using Microsoft.AspNetCore.Mvc.RazorPages;
1413
using Microsoft.AspNetCore.WebUtilities;
@@ -98,14 +97,14 @@ internal sealed class RegisterModel<TUser> : RegisterModel where TUser : class
9897
private readonly IUserStore<TUser> _userStore;
9998
private readonly IUserEmailStore<TUser> _emailStore;
10099
private readonly ILogger<RegisterModel> _logger;
101-
private readonly IEmailSender _emailSender;
100+
private readonly IEmailSender<TUser> _emailSender;
102101

103102
public RegisterModel(
104103
UserManager<TUser> userManager,
105104
IUserStore<TUser> userStore,
106105
SignInManager<TUser> signInManager,
107106
ILogger<RegisterModel> logger,
108-
IEmailSender emailSender)
107+
IEmailSender<TUser> emailSender)
109108
{
110109
_userManager = userManager;
111110
_userStore = userStore;

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/RegisterConfirmation.cshtml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.Text;
55
using Microsoft.AspNetCore.Authorization;
6-
using Microsoft.AspNetCore.Identity.UI.Services;
76
using Microsoft.AspNetCore.Mvc;
87
using Microsoft.AspNetCore.Mvc.RazorPages;
98
using Microsoft.AspNetCore.WebUtilities;
@@ -46,9 +45,9 @@ public class RegisterConfirmationModel : PageModel
4645
internal sealed class RegisterConfirmationModel<TUser> : RegisterConfirmationModel where TUser : class
4746
{
4847
private readonly UserManager<TUser> _userManager;
49-
private readonly IEmailSender _sender;
48+
private readonly IEmailSender<TUser> _sender;
5049

51-
public RegisterConfirmationModel(UserManager<TUser> userManager, IEmailSender sender)
50+
public RegisterConfirmationModel(UserManager<TUser> userManager, IEmailSender<TUser> sender)
5251
{
5352
_userManager = userManager;
5453
_sender = sender;
@@ -70,7 +69,7 @@ public override async Task<IActionResult> OnGetAsync(string email, string? retur
7069

7170
Email = email;
7271
// If the email sender is a no-op, display the confirm link in the page
73-
DisplayConfirmAccountLink = _sender is NoOpEmailSender;
72+
DisplayConfirmAccountLink = _sender is DefaultMessageEmailSender<TUser> defaultMessageSender && defaultMessageSender.IsNoOp;
7473
if (DisplayConfirmAccountLink)
7574
{
7675
var userId = await _userManager.GetUserIdAsync(user);

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ResendEmailConfirmation.cshtml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Text;
66
using System.Text.Encodings.Web;
77
using Microsoft.AspNetCore.Authorization;
8-
using Microsoft.AspNetCore.Identity.UI.Services;
98
using Microsoft.AspNetCore.Mvc;
109
using Microsoft.AspNetCore.Mvc.RazorPages;
1110
using Microsoft.AspNetCore.WebUtilities;
@@ -58,9 +57,9 @@ public class InputModel
5857
internal sealed class ResendEmailConfirmationModel<TUser> : ResendEmailConfirmationModel where TUser : class
5958
{
6059
private readonly UserManager<TUser> _userManager;
61-
private readonly IEmailSender _emailSender;
60+
private readonly IEmailSender<TUser> _emailSender;
6261

63-
public ResendEmailConfirmationModel(UserManager<TUser> userManager, IEmailSender emailSender)
62+
public ResendEmailConfirmationModel(UserManager<TUser> userManager, IEmailSender<TUser> emailSender)
6463
{
6564
_userManager = userManager;
6665
_emailSender = emailSender;

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ExternalLogin.cshtml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Text;
88
using System.Text.Encodings.Web;
99
using Microsoft.AspNetCore.Authorization;
10-
using Microsoft.AspNetCore.Identity.UI.Services;
1110
using Microsoft.AspNetCore.Mvc;
1211
using Microsoft.AspNetCore.Mvc.RazorPages;
1312
using Microsoft.AspNetCore.WebUtilities;
@@ -95,15 +94,15 @@ internal sealed class ExternalLoginModel<TUser> : ExternalLoginModel where TUser
9594
private readonly UserManager<TUser> _userManager;
9695
private readonly IUserStore<TUser> _userStore;
9796
private readonly IUserEmailStore<TUser> _emailStore;
98-
private readonly IEmailSender _emailSender;
97+
private readonly IEmailSender<TUser> _emailSender;
9998
private readonly ILogger<ExternalLoginModel> _logger;
10099

101100
public ExternalLoginModel(
102101
SignInManager<TUser> signInManager,
103102
UserManager<TUser> userManager,
104103
IUserStore<TUser> userStore,
105104
ILogger<ExternalLoginModel> logger,
106-
IEmailSender emailSender)
105+
IEmailSender<TUser> emailSender)
107106
{
108107
_signInManager = signInManager;
109108
_userManager = userManager;

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/ForgotPassword.cshtml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Text;
66
using System.Text.Encodings.Web;
77
using Microsoft.AspNetCore.Authorization;
8-
using Microsoft.AspNetCore.Identity.UI.Services;
98
using Microsoft.AspNetCore.Mvc;
109
using Microsoft.AspNetCore.Mvc.RazorPages;
1110
using Microsoft.AspNetCore.WebUtilities;
@@ -52,9 +51,9 @@ public class InputModel
5251
internal sealed class ForgotPasswordModel<TUser> : ForgotPasswordModel where TUser : class
5352
{
5453
private readonly UserManager<TUser> _userManager;
55-
private readonly IEmailSender _emailSender;
54+
private readonly IEmailSender<TUser> _emailSender;
5655

57-
public ForgotPasswordModel(UserManager<TUser> userManager, IEmailSender emailSender)
56+
public ForgotPasswordModel(UserManager<TUser> userManager, IEmailSender<TUser> emailSender)
5857
{
5958
_userManager = userManager;
6059
_emailSender = emailSender;

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Email.cshtml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.ComponentModel.DataAnnotations;
55
using System.Text;
66
using System.Text.Encodings.Web;
7-
using Microsoft.AspNetCore.Identity.UI.Services;
87
using Microsoft.AspNetCore.Mvc;
98
using Microsoft.AspNetCore.Mvc.RazorPages;
109
using Microsoft.AspNetCore.WebUtilities;
@@ -83,12 +82,12 @@ internal sealed class EmailModel<TUser> : EmailModel where TUser : class
8382
{
8483
private readonly UserManager<TUser> _userManager;
8584
private readonly SignInManager<TUser> _signInManager;
86-
private readonly IEmailSender _emailSender;
85+
private readonly IEmailSender<TUser> _emailSender;
8786

8887
public EmailModel(
8988
UserManager<TUser> userManager,
9089
SignInManager<TUser> signInManager,
91-
IEmailSender emailSender)
90+
IEmailSender<TUser> emailSender)
9291
{
9392
_userManager = userManager;
9493
_signInManager = signInManager;

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Text.Encodings.Web;
99
using Microsoft.AspNetCore.Authentication;
1010
using Microsoft.AspNetCore.Authorization;
11-
using Microsoft.AspNetCore.Identity.UI.Services;
1211
using Microsoft.AspNetCore.Mvc;
1312
using Microsoft.AspNetCore.Mvc.RazorPages;
1413
using Microsoft.AspNetCore.WebUtilities;
@@ -98,14 +97,14 @@ internal sealed class RegisterModel<TUser> : RegisterModel where TUser : class
9897
private readonly IUserStore<TUser> _userStore;
9998
private readonly IUserEmailStore<TUser> _emailStore;
10099
private readonly ILogger<RegisterModel> _logger;
101-
private readonly IEmailSender _emailSender;
100+
private readonly IEmailSender<TUser> _emailSender;
102101

103102
public RegisterModel(
104103
UserManager<TUser> userManager,
105104
IUserStore<TUser> userStore,
106105
SignInManager<TUser> signInManager,
107106
ILogger<RegisterModel> logger,
108-
IEmailSender emailSender)
107+
IEmailSender<TUser> emailSender)
109108
{
110109
_userManager = userManager;
111110
_userStore = userStore;

0 commit comments

Comments
 (0)