Exemple #1
0
        public User Authenticate(User user)
        {
            // TODO: This method will authenticate the user recovering his Ethereum address through underlaying offline ecrecover method.
            var userList  = _UCO.GetUsers();
            var validUser = userList
                            .FirstOrDefault(x => (x.Username == user.Username) && (x.Password == user.Password));

            validUser.Password = "";
            return(validUser);
        }
 public ActionResult GetUsers()
 {
     try
     {
         var userList        = _UCO.GetUsers();
         var usersDictionary = new Dictionary <string, List <User> >();
         foreach (User u in userList)
         {
             u.Password = "";
         }
         ;
         usersDictionary.Add("users", userList);
         return(Ok(usersDictionary));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }