refs #5753 fix(change-password)

This commit is contained in:
Alex Moreno 2023-06-15 11:49:39 +02:00
parent 3862e3084e
commit 99ad9d3afa
10 changed files with 16 additions and 19 deletions

View File

@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
-
## [2324.01] - 2023-06-08
## [2324.01] - 2023-06-15
### Added
- (Tickets -> Abono) Al abonar permite crear el ticket abono con almacén o sin almmacén

View File

@ -8,7 +8,7 @@ Salix is also the scientific name of a beautifull tree! :)
Required applications.
* Node.js = 14.x LTS
* Node.js >= 16.x LTS
* Docker
* Git

View File

@ -62,10 +62,9 @@ module.exports = Self => {
scopes: ['change-password'],
userId: vnUser.id
});
throw new UserError('Pass expired', 'passExpired', {
id: vnUser.id,
token: changePasswordToken.id
});
const err = new UserError('Pass expired', 'passExpired');
err.details = {token: changePasswordToken};
throw err;
}
try {

View File

@ -15,7 +15,7 @@ export default class Controller {
}
$onInit() {
if (!this.$state.params || !this.$state.params.id || !this.$state.params.token)
if (!this.$state.params.id)
this.$state.go('login');
this.$http.get('UserPasswords/findOne')
@ -25,7 +25,7 @@ export default class Controller {
}
submit() {
const id = this.$state.params.id;
const userId = this.$state.params.userId;
const newPassword = this.newPassword;
const oldPassword = this.oldPassword;
@ -35,12 +35,12 @@ export default class Controller {
throw new UserError(`Passwords don't match`);
const headers = {
Authorization: this.$state.params.token
Authorization: this.$state.params.id
};
this.$http.post('VnUsers/change-password',
{
id,
id: userId,
oldPassword,
newPassword
},

View File

@ -27,10 +27,9 @@ export default class Controller {
this.loading = false;
this.password = '';
this.focusUser();
if (req?.data?.error?.code == 'passExpired') {
const [args] = req.data.error.translateArgs;
this.$state.go('change-password', args);
}
const err = req.data?.error;
if (err?.code == 'passExpired')
this.$state.go('change-password', err.details.token);
throw req;
});

View File

@ -38,7 +38,7 @@ function config($stateProvider, $urlRouterProvider) {
})
.state('change-password', {
parent: 'outLayout',
url: '/change-password?id&token',
url: '/change-password?id&userId',
description: 'Change password',
template: '<vn-change-password></vn-change-password>'
})

View File

@ -5,8 +5,7 @@ import UserError from 'core/lib/user-error';
export default class Controller extends Section {
onSynchronizeAll() {
this.vnApp.showSuccess(this.$t('Synchronizing in the background'));
this.$http.patch(`Accounts/syncAll`)
.then(() => this.vnApp.showSuccess(this.$t('Users synchronized!')));
this.$http.patch(`Accounts/syncAll`);
}
onUserSync() {

View File

@ -1,6 +1,6 @@
{
"name": "salix-back",
"version": "23.26.01",
"version": "23.24.01",
"author": "Verdnatura Levante SL",
"description": "Salix backend",
"license": "GPL-3.0",