public IActionResult Login([FromBody] Authenticate login) { //_log4net.Info("Authentication initiated"); IActionResult response = BadRequest("error"); var user = tokenRepository.AuthenticateUser(login); if (user != null) { var tokenString = tokenRepository.GenerateJSONWebToken(user); //_log4net.Info("Token Generated"); response = Ok(tokenString); } return(response); }