Adding 2FA Authenticator Support (#66)
* 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.
This commit is contained in:
22
src/WebRazorPages/Extensions/EmailSenderExtensions.cs
Normal file
22
src/WebRazorPages/Extensions/EmailSenderExtensions.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
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>.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user