refs #5753 fix(change-password)
This commit is contained in:
parent
3862e3084e
commit
99ad9d3afa
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -71,7 +71,7 @@ $ npm run test:e2e
|
|||
|
||||
Open Visual Studio Code, press Ctrl+P and paste the following commands.
|
||||
|
||||
In Visual Studio Code we use the ESLint extension.
|
||||
In Visual Studio Code we use the ESLint extension.
|
||||
```
|
||||
ext install dbaeumer.vscode-eslint
|
||||
```
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
|
|
|
@ -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>'
|
||||
})
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue