示例#1
0
        public ActionResult PasswordResetPincode(Guid token, PasswordResetPincodeModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (_smsAuthService.VerifyResponse(token, model.Sms))
            {
                var tokenEntity = ScpContext.Services.Organizations.GetPasswordresetAccessToken(token);

                Session[WebDavAppConfigManager.Instance.SessionKeys.PasswordResetSmsKey] = model.Sms;
                Session[WebDavAppConfigManager.Instance.SessionKeys.ItemId] = tokenEntity.ItemId;

                return(RedirectToRoute(AccountRouteNames.PasswordResetFinalStep));
            }

            AddMessage(MessageType.Error, Resources.Messages.IncorrectSmsResponse);

            return(View(model));
        }
示例#2
0
        public ActionResult PasswordResetPincode(Guid token)
        {
            var model = new PasswordResetPincodeModel();

            var accessToken = ScpContext.Services.Organizations.GetPasswordresetAccessToken(token);

            model.IsTokenExist = accessToken != null;

            if (model.IsTokenExist == false)
            {
                AddMessage(MessageType.Error, Resources.Messages.IncorrectPasswordResetUrl);

                return(RedirectToRoute(AccountRouteNames.PasswordResetLogin));
            }


            if (accessToken != null && accessToken.IsSmsSent == false)
            {
                return(RedirectToRoute(AccountRouteNames.PasswordResetPincodeSendOptions));
            }

            return(View(model));
        }