diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Auth/UserManagementService.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Auth/UserManagementService.cs index 4d973a25d..4481d7a18 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Auth/UserManagementService.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Auth/UserManagementService.cs @@ -8,7 +8,7 @@ namespace Coalesce.Starter.Vue.Data.Auth; public class UserManagementService( - UserManager _userManager, + UserManager userManager, IUrlHelper urlHelper, IEmailService emailSender ) @@ -18,7 +18,7 @@ public async Task SendEmailConfirmationRequest(User user) if (user.EmailConfirmed) return "Email is already confirmed."; if (string.IsNullOrWhiteSpace(user.Email)) return "User has no email"; - var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); + var code = await userManager.GenerateEmailConfirmationTokenAsync(user); var link = urlHelper.PageLink("/ConfirmEmail", values: new { userId = user.Id, code = code })!; @@ -45,7 +45,7 @@ public async Task SendEmailChangeRequest(User user, string newEmail) // Regular users can only fetch themselves out of the data source, // admins can only view users in their own tenant, // and tenant admins can view everyone. - + if (string.IsNullOrEmpty(newEmail) || !MailAddress.TryCreate(newEmail, out _)) { return "New email is not valid."; @@ -56,12 +56,12 @@ public async Task SendEmailChangeRequest(User user, string newEmail) return "New email is not different."; } - var code = await _userManager.GenerateChangeEmailTokenAsync(user, newEmail); + var code = await userManager.GenerateChangeEmailTokenAsync(user, newEmail); var link = urlHelper.PageLink("/ConfirmEmail", values: new { userId = user.Id, code = code, newEmail = newEmail })!; var result = await emailSender.SendEmailAsync( - newEmail, + newEmail, "Confirm your email", $""" Please click here to complete your email change request. @@ -81,7 +81,7 @@ public async Task SendPasswordResetRequest(User? user) { if (user?.Email is not null) { - var code = await _userManager.GeneratePasswordResetTokenAsync(user); + var code = await userManager.GeneratePasswordResetTokenAsync(user); var link = urlHelper.PageLink("ResetPassword", values: new { userId = user.Id, code = code })!;