Пример #1
0
        public async Task <ActionResult> Login(ViewModels.LoginViewModel login, string returnurl)

        {
            LdapUser user;

            try
            {
                user = await _accountModel.Authenticate(login.Username, login.Password);
            }
            catch (AuthenticationException e)
            {
                SetErrorNotification("Login gagal. " + e.ErrorMessage);
                return(View(login));
            }

            if (user != null)
            {
                return(await ProccessLogin(user.Nip, user.Nim, user.TipeAkun.ToString(), login, returnurl, user));
            }
            else
            {
                return(Redirect(login.ReturnUrl));
            }
        }