Esempio n. 1
0
        //TODO WRAP AROUND TRY/CATCH
        public ActionResult Index()
        {
            //obtain cookie
            var authToken = CookieHandler.retriveValueFromCookie(Request, "SoundCloudToken");

            /* wrap this function */
            if (authToken == null)
            {
                return(RedirectToAction("Index", "Login"));
            }
            var responseFromServer = SoundCloudRestAPI.retriveMe(Request);

            User user = _userRepository.createUserFromJson(responseFromServer);

            return(View(user));
        }