* Adding support for 2fa, more auth options * WIP getting auth stuff working * Added Manage views. 2FA working now for MVC app. * Switching to using a controller for no-UI logout scenario * Adding Razor Pages impl of 2FA auth stuff. Works.
23 lines
851 B
C#
23 lines
851 B
C#
using ApplicationCore.Interfaces;
|
|
using System.Text.Encodings.Web;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Microsoft.AspNetCore.Mvc
|
|
{
|
|
public static class EmailSenderExtensions
|
|
{
|
|
public static Task SendEmailConfirmationAsync(this IEmailSender emailSender, string email, string link)
|
|
{
|
|
return emailSender.SendEmailAsync(email, "Confirm your email",
|
|
$"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(link)}'>clicking here</a>.");
|
|
}
|
|
|
|
public static Task SendResetPasswordAsync(this IEmailSender emailSender, string email, string callbackUrl)
|
|
{
|
|
return emailSender.SendEmailAsync(email, "Reset Password",
|
|
$"Please reset your password by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
|
|
}
|
|
}
|
|
|
|
}
|