Ejemplo n.º 1
0
        public IActionResult Index(bool isChecked = false)
        {
            var model = new UserDto();

            if (User.Identity.IsAuthenticated && isChecked == false)
            {
                var objectId   = _utilities.GetCurrentAADObjectId();
                var userEntity = _workoutRepository.GetUserByAADObjectId(objectId);

                if (userEntity == null)
                {
                    return(RedirectToAction("Index", "Home", new { isChecked = true }));
                }
                else
                {
                    model.ObjectId   = objectId;
                    model.Id         = userEntity.Id;
                    model.hasAccount = true;

                    return(View(model));
                }
            }

            model.hasAccount = false;

            return(View(model));
        }