public ActionResult Login(Models.LoginModel login)
        //Used this as a guide:
        //http://www.dotnetlearners.com/blogs/view/124/Login-Page-Example-In-MVC-Using-Entity-Frame-Work.aspx
        {
            if (ModelState.IsValid)
            {
                var db = new TheaterDbEntities();
                try
                {
                    var user = (from userlist in db.Customers
                                where userlist.Username == login.Username && userlist.Password == login.Password
                                select new { userlist.Customer_ID, userlist.First_Name, userlist.Last_Name }).ToList();

                    if (user.FirstOrDefault() != null)
                    {
                        Session["Customer_ID"] = user.FirstOrDefault().Customer_ID;
                        Session["Full_Name"]   = user.FirstOrDefault().First_Name + " " + user.FirstOrDefault().Last_Name;
                        return(Redirect("/Home/Index"));
                    }
                    ModelState.AddModelError("", "Invalid Login Credentials");
                    return(View(login));
                }
                catch (Exception e)
                {
                    ModelState.AddModelError("", e.Message);
                    return(View(login));
                }
            }
            else
            {
                ModelState.AddModelError("", "Invalid Model State");
                return(View(login));
            }
        }
Ejemplo n.º 2
0
        public User ValidateUser(Models.LoginModel loginModel)
        {
            try
            {
                var  crypto = new SimpleCrypto.PBKDF2();
                User user   = userrepo.Find(model => model.LoginID == loginModel.LoginID);
                if (user != null)
                {
                    if (user.Password == crypto.Compute(loginModel.Password, user.PasswordSalt))
                    {
                        return(user);
                    }
                    else
                    {
                        return(null);
                    }
                }


                return(user);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Ejemplo n.º 3
0
        public ActionResult Login(Models.LoginModel model)
        {
            if (ModelState.IsValid)
            {
                // поиск пользователя в бд
                User user = null;
                using (UserContext db = new UserContext())
                {
                    user = db.Users.FirstOrDefault(u => u.Email == model.Name);
                }
                if (user != null)
                {
                    string salt   = user.Salt;
                    string hashed = FormsAuthentication.HashPasswordForStoringInConfigFile(model.Password + salt, "SHA1");

                    if (user.Password == hashed)
                    {
                        FormsAuthentication.SetAuthCookie(model.Name, true);
                        return(RedirectToAction("Index", "Home"));
                    }
                    else
                    {
                        ModelState.AddModelError("", "Пользователя с таким логином и паролем нет");
                    }
                }
                else
                {
                    ModelState.AddModelError("", "Пользователя с таким логином и паролем нет");
                }
            }
            return(View(model));
        }
        public ActionResult Login(string user, string pass)
        {
            var modelLogin        = new Models.LoginModel();
            var modelMantenedores = new Models.MantenedorModel();

            var usuarioId = modelLogin.Login(user, pass);


            if (usuarioId >= 0)
            {
                Models.DTO.Usuario usuario = modelMantenedores.ObtenerUsuarioPorId(usuarioId);
                SessionHandler.Logged    = true;
                SessionHandler.Usuario   = usuario.nombre;
                SessionHandler.UsuarioId = usuarioId;
                SessionHandler.Mail      = usuario.email;
                SessionHandler.Perfil    = usuario.perfil.Id;
                SessionHandler.EmpresaId = usuario.empresa.empresaId;
                SessionHandler.pwdEstado = usuario.pwdEstado;
                return(Json(new { response = "success" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                switch (usuarioId)
                {
                case -1:
                    return(Json(new { response = "error", message = "Nombre de usuario o password incorrecto" }, JsonRequestBehavior.AllowGet));

                case -2:
                    return(Json(new { response = "error", message = "No se ha podido establecer una conexion con el servidor" }, JsonRequestBehavior.AllowGet));
                }
                return(Json(new { response = "error", message = "Error Desconocido" }, JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 5
0
 public LoginViewModel(INavigation nav)
 {
     Nav          = nav;
     Model        = new Models.LoginModel();
     Dialogs      = UserDialogs.Instance;
     LoginCommand = new Command(_ => OnLogin().ConfigureAwait(false));
 }
Ejemplo n.º 6
0
        public async Task <IActionResult> LoginAsync(Models.LoginModel loginModel)
        {
            try{
            }catch (Exception ex) {
                _logger.LogError($"Error: {ex}");
                return(RedirectToAction("Error"));
            }
            if (ModelState.IsValid)
            {
                if (loginService.autenticacion(loginModel))
                {
                    var claims = new List <Claim>
                    {
                        new Claim("user", "user"),
                        new Claim("role", "Member")
                    };

                    await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "role")));

                    return(RedirectToAction("autenticado", "login"));
                }
                ModelState.AddModelError(string.Empty, "Acceso negado");
            }
            return(View(loginModel));
        }
Ejemplo n.º 7
0
        public ActionResult Login(ContentModel model, string returnUrl = "/", string code = "")
        {
            var loginModel = new Models.LoginModel(model.Content);

            if (!code.IsNullOrEmpty())
            {
                var result = _client.GetTokenAsync(new AuthorizationCodeTokenRequest
                {
                    ClientId     = Auth0Helper.Auth0ClientId,
                    ClientSecret = Auth0Helper.Auth0ClientSecret,
                    Code         = code,
                    RedirectUri  = loginModel.GetRedirectUri()
                }).GetAwaiter().GetResult();


                UserInfo user = _client.GetUserInfoAsync(result.AccessToken).GetAwaiter().GetResult();

                // Authenticate
                _auth0Helper.Authenticate(user, true, AuthenticationManager);

                returnUrl = returnUrl == "/" ? $"/{CurrentUser.LanguageCode}/account/my-profile/" : returnUrl;

                return(RedirectToLocal(returnUrl, loginModel));
            }

            return(CurrentTemplate(loginModel));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> OnPostAsync(string returnUrl = null)
        {
            returnUrl ??= Url.Content("~/");

            ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();


            if (ModelState.IsValid)
            {
                // This doesn't count login failures towards account lockout
                // To enable password failures to trigger account lockout, set lockoutOnFailure: true
                Models.LoginModel loginModel = new Models.LoginModel();
                loginModel.Username = Input.Email;
                loginModel.Password = Input.Password;
                var result = await _authenticationApi.Login(loginModel);

                if (result is OkObjectResult success)
                {
                    _logger.LogInformation("User logged in.");
                    return(LocalRedirect(returnUrl));
                }
                else
                {
                    ModelState.AddModelError(string.Empty, "Invalid login attempt.");
                    return(Page());
                }
            }

            // If we got this far, something failed, redisplay form
            return(Page());
        }
Ejemplo n.º 9
0
        public ActionResult ChangePassword(string cureentPwd, string newPwd)
        {
            var path = Server.MapPath(DBQueries.xmlCredentialsPath);

            Models.LoginModel user = null;
            using (LoginModel obj = new LoginModel())
            {
                var credentials = obj.readXml(path);
                user = credentials.Find(x => x.loginId == HttpContext.User.Identity.Name && x.password == cureentPwd);
            }
            if (user != null)
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(path);

                XmlNodeList aDateNodes = doc.SelectNodes("/user/UserDetails");
                foreach (XmlNode aDateNode in aDateNodes)
                {
                    if (aDateNode.FirstChild.InnerText == user.loginId)
                    {
                        aDateNode.SelectSingleNode("Password").InnerText = newPwd;
                        break;
                    }
                }
                doc.Save(path);
                return(Json(DBQueries.msgChangePassSuccess, JsonRequestBehavior.AllowGet));
            }
            return(Json(DBQueries.msgCurrentPwdNotMatch, JsonRequestBehavior.AllowGet));
        }
 public JsonResult Login(Models.LoginModel model)
 {
     if (ModelState.IsValid)
     {
         //首先判断下验证码是否正确
         if (Session["ValidateImgCode"] != null && string.Equals(Session["ValidateImgCode"].ToString(),
                                                                 model.ValidateCode, StringComparison.OrdinalIgnoreCase))
         {
             OperateResult operateResult = _empService.Login(model.UserName, model.Password, (byte)LoginSource.后台);
             if (operateResult.OperateState == OperateStateType.Success)
             {
                 SessionHelper.SetSession("EmpInfo", operateResult.OData);
                 return(Json(new { state = "success", message = operateResult.Message }));
             }
             else
             {
                 return(Json(new { state = "error", message = operateResult.Message }));
             }
         }
         else
         {
             return(Json(new {
                 state = "error",
                 message = "验证码错误"
             }));
         }
     }
     else
     {
         return(Json(new {
             state = "error",
             message = "输入信息不完整"
         }));
     }
 }
        public ActionResult Login(Models.LoginModel model)
        {
            if (ModelState.IsValid)
            {
                SecurityBLL security = new SecurityBLL();
                string      token    = security.VerifyUser(model.UserId.ToUpper().Trim(), model.Password.ToUpper().Trim(), ClientIPAddress);

                if (string.IsNullOrWhiteSpace(token))
                {
                    ModelState.AddModelError(string.Empty, "User not found.");
                    return(View(model));
                }

                FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
                    1,
                    token,
                    DateTime.Now,
                    DateTime.Now.AddMinutes(30),
                    false,
                    "User"
                    );

                string     formsCookieStr = FormsAuthentication.Encrypt(ticket);
                HttpCookie formsCookie    = new HttpCookie(FormsAuthentication.FormsCookieName, formsCookieStr);
                HttpContext.Response.Cookies.Add(formsCookie);
                return(RedirectToAction("Index", "Home"));
            }
            ModelState.AddModelError(string.Empty, "User or password incorrect.");
            return(View(model));
        }
Ejemplo n.º 12
0
        public ActionResult Login(Models.LoginModel logininfo)
        {
            // logic to authenticate user goes here
            using (BusinessLogicLayer.BLLContext ctx = new BusinessLogicLayer.BLLContext())
            {
                var user = ctx.Users.FindUserByEmail(logininfo.Username);
                if (user == null)
                {
                    return(View(logininfo.SetMessage("not a Valid Username")));
                }

                string actual     = user.Password;
                string potential  = user.Salt + logininfo.Password;
                bool   checkedout = System.Web.Helpers.Crypto.
                                    VerifyHashedPassword(actual, potential);
                if (checkedout)
                {
                    Session["AUTHUsername"] = logininfo.Username;
                    Session["AUTHRoles"]    = user.Roles;
                    if (logininfo.ReturnURL == null)
                    {
                        logininfo.ReturnURL = @"~\home";
                    }
                    return(Redirect(logininfo.ReturnURL));
                }

                return(View(logininfo.SetMessage("Not a Valid Login")));
            }
        }
Ejemplo n.º 13
0
        public async Task <ActionResult> Dashboard()
        {
            if (null != Session[Constants.SESSION_OBJ_USER])
            {
                var data = (UserAccount)Session[Constants.SESSION_OBJ_USER];
                EmployeeDetailsModel datares = await user.GetUserDetailsAsync(data.RefEmployeeId);

                Models.LoginModel model = new Models.LoginModel();
                model.EmpName         = data.UserName;
                model.UserName        = data.UserName;
                model.Projectname     = datares.ProjectName;
                model.ManagerName     = datares.ManagerName;
                model.TotalLeaveCount = Convert.ToInt16(datares.TotalLeaveCount);
                model.TotalTaken      = datares.TotalCountTaken;
                model.TotalLeft       = Convert.ToInt16(datares.TotalLeaveCount - datares.TotalCountTaken);
                model.DateOfJoining   = DateTime.Now;
                model.RoleName        = datares.RoleName;
                model.Announcements   = new List <Models.Announcement>();
                foreach (var item in datares.Announcements)
                {
                    Models.Announcement announceItem = new Models.Announcement();
                    announceItem.ImagePath       = item.ImagePath;
                    announceItem.CarouselContent = item.CarouselContent;
                    announceItem.Title           = item.Title;
                    model.Announcements.Add(announceItem);
                }
                model.LeaveDetails = datares.LeaveDetails;
                // model.Announcements = (Models.Announcement)datares.Announcements;
                return(View(model));
            }
            return(View("Login"));
        }
 public ActionResult HandleLogin(Models.LoginModel model)
 {
     if (ModelState.IsValid)
     {
         var m = Member.GetMemberFromLoginNameAndPassword(model.Login, model.Password);
         if (m != null)
         {
             Member.AddMemberToCache(m);
             _memberInfoManager.AddMemberToCache(Response, m);
             string redirectUrl;
             if (System.Web.Security.Roles.IsUserInRole(model.Login, "Desk"))
             {
                 redirectUrl = "/disk/?login=ok";
             }
             else
             {
                 redirectUrl = Umbraco.TypedContentAtXPath("//" + ConfigurationManager.AppSettings["umbracoOrderListPageContentDocumentType"]).First().Url + "?login=ok";
             }
             Response.Redirect(redirectUrl);
         }
         else
         {
             Response.Redirect(CurrentPage.Url + "?error=invalid-member");
         }
     }
     else
     {
         Response.Redirect(CurrentPage.Url + "?error=invalid-model");
     }
     return(RedirectToCurrentUmbracoPage());
 }
Ejemplo n.º 15
0
        public async Task <IActionResult> Login(string email, string password)
        {
            var loginModel = new Models.LoginModel()
            {
                Email    = email,
                Password = password
            };
            var content = _responseAPI.GetContent <Models.LoginModel>(loginModel);

            HttpClient client = new HttpClient();

            using (client = _responseAPI.Initial())
            {
                HttpResponseMessage rs = await client.PostAsync("api/Account/Auth", content);

                if (rs.IsSuccessStatusCode)
                {
                    var result = _responseAPI.ReadAsJsonAsync <TokenModel>(rs.Content).Result;
                    HttpContext.Session.SetString("userToken", result.Token);

                    HttpContext.Session.SetString("email", email);
                    HttpContext.Session.SetString("address", result.Address);
                    HttpContext.Session.SetString("fullName", result.FullName);
                    HttpContext.Session.SetString("imagePath", result.ImagePath);
                    HttpContext.Session.SetString("phoneNumber", result.PhoneNumber);
                    return(RedirectToAction("Index", "Home"));
                }
                return(RedirectToAction("Index", "Account", new { message = "Username and password doesn't match!!!" }));
            }
        }
Ejemplo n.º 16
0
        public ActionResult LogIn(LoginModel loginModel, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                var user = userManager.LogIn(loginModel.UserName, loginModel.Password);


                if (user == null)
                {
                    ModelState.AddModelError("", "User name and password do not match.");
                }
                else
                {
                    Session["User"] = new Models.LoginModel {
                        Id = user.Id, UserName = user.Name
                    };

                    System.Web.Security.FormsAuthentication.SetAuthCookie(loginModel.UserName, false);

                    return(Redirect(returnUrl ?? "~/"));
                }
            }

            return(View(loginModel));
        }
        public ActionResult Login(Models.LoginModel loginModel)
        {
            if (ModelState.IsValid)
            {
                var usr = db.users.Where(u => u.Email.ToLower() == loginModel.Email.ToLower() && u.Password == loginModel.Password).First();
                if (usr == null)
                {
                    ViewBag.error = "Invalid Login";
                }
                else if (usr.adminUser == null)
                {
                    ViewBag.error = "You have to login with admin account";
                }
                else
                {
                    Session["id"]   = usr.Id;
                    Session["name"] = usr.Name;
                    Session["type"] = "Admin";
                    //system default identity set
                    //IsAuthorize Property true

                    if (Session["dv"] == null || Session["dv"].ToString() == "")
                    {
                        return(RedirectToAction("Index", "Home"));
                    }
                    return(RedirectToAction(Session["dv"].ToString(), Session["dc"].ToString()));
                }
            }
            return(View(loginModel));
        }
Ejemplo n.º 18
0
        public ActionResult Login(Models.LoginModel model)
        {
            if (ModelState.IsValid)
            {
                using (var context = new Data.TCFPEntities())
                {
                    var result = context.sp_Login(model.Email, model.Password).SingleOrDefault();

                    if (result != 1)
                    {
                        ModelState.AddModelError("E0010", Resources.Message.E0010);
                        return(View());
                    }
                    else
                    {
                        FormsAuthentication.SetAuthCookie(model.Email, true);
                        return(RedirectToAction("Index"));
                    }
                }
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 19
0
 public ActionResult Login(Models.LoginModel model)
 {
     if (ModelState.IsValid)
     {
         var dao    = new UserDao();
         var result = dao.Login(model.UserName, Encryptor.MD5Hash(model.Password));
         if (result == 1)
         {
             var user        = dao.GetById(model.UserName);
             var userSession = new UserLogin();
             userSession.UserName = user.UserName;
             userSession.UserID   = user.ID;
             Session.Add(CommonConstants.USER_SESSION, userSession);
             return(Redirect("/"));
         }
         else if (result == 0)
         {
             ModelState.AddModelError("", "Tài khoản không tồn tại.");
         }
         else if (result == -1)
         {
             ModelState.AddModelError("", "Tài khoản đang bị khoá.");
         }
         else if (result == -2)
         {
             ModelState.AddModelError("", "Mật khẩu không đúng.");
         }
         else
         {
             ModelState.AddModelError("", "đăng nhập không đúng.");
         }
     }
     return(View(model));
 }
        public ActionResult Login(Models.LoginModel loginModel)
        {
            if (ModelState.IsValid)
            {
                var employee = db.Employees.Where(e => e.EmployeeEmail.ToLower() == loginModel.Email.ToLower() && e.EmployeePassword == loginModel.Password).FirstOrDefault();

                if (employee == null)
                {
                    ViewBag.error = "Invalid Email or Password";
                }

                else if (employee.EmployeeAdmin == null)
                {
                    ViewBag.error = "You have to login with Admin Account";
                }

                else
                {
                    Session["Id"]           = employee.ID;
                    Session["EmployeeName"] = employee.EmployeeName;
                    Session["type"]         = "Admin";

                    if (Session["DefaultView"] == null || Session["DefaultView"].ToString() == "")
                    {
                        return(RedirectToAction("Index", "Home"));
                    }

                    return(RedirectToAction(Session["DefaultView"].ToString(), Session["DefaultControll"].ToString()));
                }
            }
            return(View(loginModel));
        }
Ejemplo n.º 21
0
        public ActionResult LoginView(Models.LoginModel user)
        {
            user.Username = Request.Form["email"];
            user.Password = Request.Form["pass"];
            string remember = Request.Form["remember-me"];

            if (remember == "on")
            {
                user.RememberMe = true;
            }
            else
            {
                user.RememberMe = false;
            }


            if (user.IsValid(user.Username, user.Password))
            {
                FormsAuthentication.SetAuthCookie(user.Username, user.RememberMe);
                Session["username"] = user.Username;
                if (user.Username == "*****@*****.**")
                {
                    Session["username"] = user.Username;
                    return(RedirectToAction("AdminView", "Admin"));
                }
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                TempData["LoginFailed"] = "fail";
                ModelState.AddModelError("", "Login data is incorrect!");
            }
            return(View(user));
        }
Ejemplo n.º 22
0
        //POST : /api/ApplicationUser/Login
        public async Task <IActionResult> Login(Models.LoginModel model)
        {
            var user = await _userManager.FindByNameAsync(model.UserName);

            if (user != null && await _userManager.CheckPasswordAsync(user, model.Password))
            {
                //Get role assigned to the user
                var role = await _userManager.GetRolesAsync(user);

                IdentityOptions _options = new IdentityOptions();

                var tokenDescriptor = new SecurityTokenDescriptor
                {
                    Subject = new ClaimsIdentity(new Claim[]
                    {
                        new Claim("UserID", user.Id.ToString()),
                        new Claim(_options.ClaimsIdentity.RoleClaimType, role.FirstOrDefault())
                    }),
                    Expires            = DateTime.UtcNow.AddDays(1),
                    SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_appSettings.JWT_Secret)), SecurityAlgorithms.HmacSha256Signature)
                };
                var tokenHandler  = new JwtSecurityTokenHandler();
                var securityToken = tokenHandler.CreateToken(tokenDescriptor);
                var token         = tokenHandler.WriteToken(securityToken);
                return(Ok(new { token }));
            }
            else
            {
                return(BadRequest(new { message = "Username or password is incorrect." }));
            }
        }
Ejemplo n.º 23
0
        public ActionResult Account(Models.LoginModel model)
        {
            var script = string.Format("alert('aaa');");

            if (ModelState.IsValid)
            {
                var admin  = conn.adminUser.FirstOrDefault(a => a.userName == model.Accounts);
                var select = conn.Users.FirstOrDefault(r => r.Accounts == model.Accounts);

                if (select == null)
                {
                    if (admin == null || admin.password != model.Password)
                    {
                        //return Content("账号或密码错误");
                        return(Content("<script>alert('账号或密码错误');history.go(-1);location.reload();</script>", "text/html"));
                    }

                    else if (admin.userName == model.Accounts && admin.password == model.Password)
                    {
                        Session["adminName"] = admin.userName;
                        Session["adminID"]   = admin.ID;
                        return(RedirectToAction("Index", "Admin", new { area = "Admin" }));
                    }
                }
                else if (select.Accounts == model.Accounts && select.Password == model.Password)
                {
                    Session["userName"]     = select.Nickname;
                    Session["userLogo"]     = select.UserLogo;
                    Session["userAccounts"] = model.Accounts;
                    Session["userID"]       = select.ID;
                    return(RedirectToAction("Index", "Home"));
                }

                else if (select.Password != model.Password)
                {
                    //return Content("账号或密码错误");


                    return(Content("<script>alert('账号或密码错误');history.go(-1);location.reload();</script>", "text/html"));
                }
            }
            return(Content("数据有误"));
            //var id = Request["username"];
            //var password = Request["password"];
            //var select = conn.Users.FirstOrDefault(r => r.Accounts == id);

            //if (select == null)
            //{
            //    return View();
            //}
            //else if (select.Accounts == id &&select.Password == password)
            //{
            //    return Content("zhuce");
            //}
            //else
            //{
            //    return Content("账号密码错误");
            //}
        }
Ejemplo n.º 24
0
        private List <Claim> GetClaims(Models.LoginModel models)
        {
            var claims = new List <Claim>();

            claims.Add(new Claim(ClaimTypes.Email, models.Email));
            claims.Add(new Claim(ClaimTypes.Name, "Chandresh"));
            return(claims);
        }
 public ActionResult Login(Models.LoginModel user)
 {
     if (ModelState.IsValid)
     {
         FormsAuthentication.SetAuthCookie(user.Username, user.RememberMe);
         return(RedirectToAction("Index", "Home"));
     }
     return(View(user));
 }
Ejemplo n.º 26
0
        public ActionResult Index()
        {
            Ciira.Models.LoginModel model = new Models.LoginModel();
            model.Email     = "";
            model.Password  = "";
            model.ReturnUrl = "";

            return(View(model));
        }
Ejemplo n.º 27
0
 public ActionResult Login()
 {
     Models.LoginModel m = new Models.LoginModel();
     m.Message   = TempData["message"]?.ToString() ?? "x";
     m.ReturnURL = TempData["returnurl"]?.ToString() ?? @"~\Home";
     m.Username  = "******";
     m.Password  = "******";
     return(View(m));
 }
Ejemplo n.º 28
0
 public ActionResult Login()
 {
     // displays empty login screen with predefined returnURL
     Models.LoginModel mapper = new Models.LoginModel();
     mapper.Message   = TempData["Message"]?.ToString() ?? "";
     mapper.ReturnURL = TempData["ReturnURL"]?.ToString() ?? @"~/Home";
     mapper.UserName  = "";
     mapper.Password  = "";
     return(View(mapper));
 }
Ejemplo n.º 29
0
        public ActionResult Welcome(Models.LoginModel loguser)
        {
            string user     = loguser.User;
            string password = loguser.Password;

            ViewData["Message"]  = "Hello " + user;
            ViewData["NumTimes"] = 4;

            return(View());
        }
Ejemplo n.º 30
0
        public ActionResult Login(Models.LoginModel model)
        {
            if (Membership.ValidateUser(model.Username, model.Password))
            {
                FormsAuthentication.SetAuthCookie(model.Username, true);

                Session["name"] = model.Username;
                return(RedirectToAction("Index", "Posts"));
            }
            return(RedirectToAction("Login"));
        }
Ejemplo n.º 31
0
 public LoginViewModel()
 {
     login = new Models.LoginModel();
 }