public async Task <IActionResult> Index()
        {
            var roles = await _authClient.GetRoles();

            var model = new RoleManagementViewModel
            {
                Roles       = roles,
                NewRoleName = null
            };

            return(View(model));
        }
        public async Task <IActionResult> Add(RoleManagementViewModel model)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(model.NewRoleName))
                {
                    return(BadRequest());
                }

                var success = await _authClient.AddRole(model.NewRoleName);

                if (success)
                {
                    return(RedirectToAction("Index", "RoleManagement"));
                }

                return(RedirectToAction("Index", "Error"));
            }
            catch (Exception e)
            {
                return(RedirectToAction("Index", "Error"));
            }
        }