public ActionResult SignUpInit()
        {
            if (Request.IsAuthenticated)
            {
                return(RedirectToAction("Index", "Home"));
            }

            return(Redirect(Esi.GetRedirectUrl(state: "signup")));
        }
        public ActionResult RedirectToSso(/*List<string> scopes*/ FormCollection obj)
        {
            // var debug = obj.AllKeys.Aggregate("", (current, k) => current + $"{k}: {obj[k]}<br/>");

            var scopes = new List <string>();

            // Register individually selected scopes
            if (obj.AllKeys.Contains("scopes-character"))
            {
                scopes.AddRange(obj["scopes-character"].Split(','));
            }

            if (obj.AllKeys.Contains("scopes-corporation"))
            {
                scopes.AddRange(obj["scopes-corporation"].Split(','));
            }

            // Register presets
            var presets = obj.AllKeys.Where(k => k.StartsWith("preset"));

            // Process presets
            foreach (var p in presets)
            {
                var presetResponse = ScopePresetsHelper.GetScopesForPreset(p);
                if (presetResponse == "")
                {
                    continue; // Preset doesn't exist or didn't register any scopes
                }

                // Get individual scopes from preset and individually add them to list of scopes if they aren't there already.
                var presetResponseScopes = presetResponse.Split(' ');
                foreach (var presetScope in presetResponseScopes)
                {
                    if (!scopes.Contains(presetScope))
                    {
                        scopes.Add(presetScope);
                    }
                }
            }

            var redirectUrl = Esi.GetRedirectUrl(string.Join(" ", scopes), "add");

            return(Redirect(redirectUrl));
            // DEBUG
            //dynamic data = new {
            //    _scopes = scopes,
            //    _presets = presets,
            //    _indy = ScopePresetsHelper.GetScopesForPreset("presetCharacterIndustry"),
            //    _debug = _debug,
            //    redirect_string = EsiApiModule.GetRedirectUrl(String.Join(" ",scopes))
            //};
            //return Content($"<pre>{JsonConvert.SerializeObject(data, Formatting.Indented)}</pre>");
        }