Exemple #1
0
        public virtual ActionResult Find(string e)
        {
            if (String.IsNullOrWhiteSpace(e))
            {
                return(View("NoDomain"));
            }
            var t = Tenants.All().FirstOrDefault(x => !String.IsNullOrWhiteSpace(x.EmailDomain) && e.Contains(x.EmailDomain));

            if (null == t)
            {
                ViewData["e"] = e;
                return(View("NoDomain"));
            }

            Session["RedirectedLogin"] = e;
            var host = t.Match[0];

            if (!host.StartsWith("http://") ||
                !host.StartsWith("https://"))
            {
                host = "http://" + host;
            }
            var uri = new Uri(host, UriKind.Absolute);

            uri = new Uri(uri, "/login");
            return(Redirect(uri.ToString()));
        }