Example #1
0
 public User AuthenticateUser(string userName, string password)
 {
     Core.Model.Appuser user = UserManager.Find(userName, password);
     if (user != null)
     {
         user.IsActive = true;
         UserManager.Update(user);
         User           userObj = AutoMapper.Mapper.Map <Core.Model.Appuser, User>(user);
         IList <string> roles   = UserManager.GetRoles(user.Id);
         userObj.Roles = roles;
         return(userObj);
     }
     return(null);
 }
Example #2
0
 public User ForgotPassword(string email)
 {
     Core.Model.Appuser user = UserManager.FindByEmail(email);
     return(AutoMapper.Mapper.Map <Core.Model.Appuser, User>(user));
 }