Beispiel #1
0
 public async Task <bool> Login(User user)
 {
     _logger.LogInformation("Starting Login");
     try
     {
         return(await _userDataProvider.Login(user));
     }
     catch (Exception e)
     {
         _logger.LogInformation("Error Login");
         throw;
     }
 }
        public async Task <object> Login(UserViewModel user)
        {
            object result;

            if (!ModelState.IsValid)
            {
                return(new { Error = ModelState.Errors() });;
            }

            result = await userDataProvider.Login(user);

            return(result);
        }
        public async Task <object> Login(UserViewModel user)
        {
            object result;

            if (!ModelState.IsValid)
            {
                //get user model error via helper class and return
                return(new { Error = ModelState.Errors() });;
            }

            //return user info after successfull login
            result = await userDataProvider.Login(user);

            return(result);
        }