2018-12-18 15:42:39 +01:00
|
|
|
|
using System.Security.Claims;
|
2018-12-01 22:12:59 +01:00
|
|
|
|
using System.Threading.Tasks;
|
2018-12-19 12:55:35 +01:00
|
|
|
|
using Microsoft.AspNet.Identity;
|
|
|
|
|
using Microsoft.AspNet.Identity.EntityFramework;
|
2018-12-01 22:12:59 +01:00
|
|
|
|
|
|
|
|
|
namespace Forum.DataAccessLayer.Models
|
|
|
|
|
{
|
|
|
|
|
public class ProfessionalUser : IdentityUser
|
|
|
|
|
{
|
2018-12-01 22:41:14 +01:00
|
|
|
|
public string FullName { get; set; }
|
|
|
|
|
|
2018-12-01 22:12:59 +01:00
|
|
|
|
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ProfessionalUser> manager)
|
|
|
|
|
{
|
|
|
|
|
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
|
|
|
|
|
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
|
|
|
|
|
// Add custom user claims here
|
|
|
|
|
return userIdentity;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|