public async Task <IActionResult> ConfirmEmail(string userId, string token) { try { var role = _accessor.HttpContext.User.Claims.Where(c => c.Type == ClaimTypes.Role).SingleOrDefault(); if (string.IsNullOrEmpty(userId) || string.IsNullOrWhiteSpace(token)) { return(NotFound()); } var result = await _accountServices.ConfirmEmailAsync(userId, token); if (result.IsSuccess) { return(Ok(result)); } return(BadRequest(result)); } catch (Exception ex) { throw new Exception(ex.Message); } }