Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC Add Secondary Email using asp.net Identity

I'm new in MVC and ASP.NET Identity. Is there any way to add a secondry email using ASP.NET Identity ?

I need to give a user the ability to add a second email to use it in my application.

like image 693
Turgut Kanceltik Avatar asked Jan 08 '16 09:01

Turgut Kanceltik


1 Answers

You extend the ApplicationUser Entity to add additional properties.

public class ApplicationUser : IdentityUser
{
    public string SecondaryEmail { get; set; }
}

You will need to update your register view models and actions to get the details parsed through.

If you want the user to be able to login with this secondary email you need a custom implementation of SignInManager<ApplicationUser>.

like image 86
Ashley Medway Avatar answered Sep 21 '22 03:09

Ashley Medway