Example #1
0
        public ActionResult DoFacebookLogin(string username, string email)
        {
            var validUsername = UserService.ValidateUser(email);

            if (string.IsNullOrEmpty(validUsername))
            {
                FormsAuthentication.SetAuthCookie(username, false);

                UserService.RegisterUser(email, username, "", Server.MapPath("../Images/"));
            }
            else
            {
                FormsAuthentication.SetAuthCookie(validUsername, false);

                UserService.ActivateFacebookUser(email);
            }

            object data = new { success = true, url = Url.Action("Index", "Dashboard") };

            return(Json(data, JsonRequestBehavior.DenyGet));
        }