Ejemplo n.º 1
0
        public IActionResult OnGet()
        {
            AuthenticationObject = _context.AuthenticationObjects.FirstOrDefault();

            if (AuthenticationObject != null)
            {
                return(RedirectToPage("../PlaylistRequest/Create"));
            }

            if (!string.IsNullOrEmpty(code))
            {
                if (AuthenticationObject == null)
                {
                    SpotifyAuthentication.ExchangeCodeForToken(code, _context);
                }

                return(RedirectToPage("../PlaylistRequest/Create"));
            }

            return(Page());
        }