Esempio n. 1
0
        public ActionResult PasswordSet()
        {
            PasswordSetModel mode = new PasswordSetModel()
            {
                UserId = LoginUser.Id
            };

            return(View(mode));
        }
Esempio n. 2
0
        public async Task <ActionResult> PasswordSet(PasswordSetModel viewModel)
        {
            var result = await UserManager.ChangePasswordAsync(viewModel.UserId, viewModel.Password, viewModel.NewPassword);

            if (result.Succeeded)
            {
                EnsureLoggedOut();
                return(View(viewModel));
            }
            AddErrors(result);
            return(View(viewModel));
        }