public IActionResult Login([FromBody] Login user) { if (!ModelState.IsValid) { return(BadRequest("Parameter is missing")); } DynamicParameters dp_param = new DynamicParameters(); dp_param.Add("email", user.email, DbType.String); dp_param.Add("password", user.password, DbType.String); dp_param.Add("returnValue", DbType.String, direction: ParameterDirection.Output); var serviceResponse = _authentication.Execute_Command <Account>("sp_loginUser", dp_param); if (serviceResponse.Code == 200) { var token = _authentication.GenerateJWT(serviceResponse.Data); return(Ok(token)); } return(BadRequest("Unauthorized")); }