예제 #1
0
        private async Task <ClaimsIdentity> GetIdentity(string email, string password)
        {
            var person = await _manager.Get(email, password);

            if (person == null)
            {
                return(null);
            }
            var claims = new List <Claim>
            {
                new Claim(ClaimsIdentity.DefaultNameClaimType, person.Email),
                new Claim(ClaimsIdentity.DefaultNameClaimType, person.Phone)
            };
            var claimsIdentity =
                new ClaimsIdentity(claims, "Token", ClaimsIdentity.DefaultNameClaimType, ClaimsIdentity.DefaultNameClaimType);

            return(claimsIdentity);
        }
예제 #2
0
 public async Task <IEnumerable <Stuff> > Index()
 {
     return(await _stuffManager.Get());
 }