public async Task <ActionResult <ApiKeyData> > RevokeKey() { ControllerContext.HttpContext.GetAPIKey(out var apiKey); await _apiKeyRepository.Remove(apiKey, _userManager.GetUserId(User)); return(Ok()); }
public async Task <IActionResult> RevokeKey(string apikey) { if (!string.IsNullOrEmpty(apikey) && await _apiKeyRepository.Remove(apikey, _userManager.GetUserId(User))) { return(Ok()); } else { return(this.CreateAPIError("apikey-not-found", "This apikey does not exists")); } }
public async Task <IActionResult> RevokeKey(string apikey) { if (string.IsNullOrEmpty(apikey)) { return(NotFound()); } if (await _apiKeyRepository.Remove(apikey, _userManager.GetUserId(User))) { return(Ok()); } else { return(NotFound()); } }