public UserResponse Login(string user, string pass) { User resultantUser = _context.GetAll().Where(u => (u.Username.Equals(user) && u.Password.Equals(pass)) || (u.Email.Equals(user) && u.Password.Equals(pass))).FirstOrDefault(); string token = null; if (resultantUser != null) { token = _auth.Authentication(resultantUser.Id.ToString()); } return(new UserResponse { Fullname = resultantUser.Fullname, Email = resultantUser.Email, Address = resultantUser.Address, Id = resultantUser.Id, Token = token }); }
public IActionResult Get() { return(Ok(_roleRepository.GetAll())); }