Last active
June 12, 2018 06:42
-
-
Save kevinrodriguez-io/4691692717222a868d05a3e446605732 to your computer and use it in GitHub Desktop.
ASP.Net Core Identity UI 2.1 Account ForgotPassword
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Text.Encodings.Web; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Authorization; | |
using Microsoft.AspNetCore.Identity; | |
using Microsoft.AspNetCore.Identity.UI.Services; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.RazorPages; | |
namespace MailSenderApp.Areas.Identity.Pages.Account | |
{ | |
[AllowAnonymous] | |
public class ForgotPasswordModel : PageModel | |
{ | |
private readonly UserManager<IdentityUser> _userManager; | |
private readonly IEmailSender _emailSender; | |
public ForgotPasswordModel(UserManager<IdentityUser> userManager, IEmailSender emailSender) | |
{ | |
_userManager = userManager; | |
_emailSender = emailSender; | |
} | |
[BindProperty] | |
public InputModel Input { get; set; } | |
public class InputModel | |
{ | |
[Required] | |
[EmailAddress] | |
public string Email { get; set; } | |
} | |
public async Task<IActionResult> OnPostAsync() | |
{ | |
// OnPostAsync method logic | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment