Esempio n. 1
0
        public async Task <IActionResult> Main()
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Login", "Account"));
            }

            var userData = await _userData.GetUserData(User.Identity.Name);

            var isAdmin = await _accessManager.IsAdmin(userData.Id);

            if (isAdmin)
            {
                return(RedirectToAction("Index", "Admin"));
            }

            return(RedirectToAction("Index", "Organization"));
        }