예제 #1
0
        public ActionResult Login(string email, string password)
        {
            var db   = new ImageDb(Properties.Settings.Default.ConStr);
            var user = db.Login(email, password);

            if (user == null)
            {
                TempData["message"] = "Invalid login attempt";
                return(Redirect("/home/upload"));
            }

            FormsAuthentication.SetAuthCookie(email, true);
            return(Redirect("/"));
        }