Skip to content

Instantly share code, notes, and snippets.

@kevinrodriguez-io
Last active June 12, 2018 06:42
Show Gist options
  • Save kevinrodriguez-io/4691692717222a868d05a3e446605732 to your computer and use it in GitHub Desktop.
Save kevinrodriguez-io/4691692717222a868d05a3e446605732 to your computer and use it in GitHub Desktop.
ASP.Net Core Identity UI 2.1 Account ForgotPassword
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