예제 #1
0
        public async Task <IHttpActionResult> CambiarPassword([FromBody] CambiarPasswordViewModel model)
        {
            var identityResult = await authLogic.CambiarPassword(model.UsuarioId, model.Password);

            if (identityResult.Succeeded)
            {
                return(Ok());
            }
            else
            {
                return(BadRequest(IdentityAuthErrorMessages.GetAppendedIdentityResultErrors(identityResult)));
            }
        }
예제 #2
0
        public async Task <IHttpActionResult> CambiarActualPassword([FromUri] string userId, [FromBody] ChangePasswordModel changePasswordModel)
        {
            var currentPassword = changePasswordModel.currentPassword;

            var newPassword = changePasswordModel.newPassword;

            var identityResult = await authLogic.CambiarPassword(userId, currentPassword, newPassword);

            if (identityResult.Succeeded)
            {
                return(Ok());
            }
            else
            {
                return(BadRequest(IdentityAuthErrorMessages.GetAppendedIdentityResultErrors(identityResult)));
            }
        }