fix(salix): refs #7272 #7272 Remove aclService from auth.js

This commit is contained in:
Javier Segarra 2024-04-30 11:26:12 +02:00
parent 596c0f78d0
commit 6277c3da09
1 changed files with 7 additions and 12 deletions

View File

@ -7,18 +7,15 @@ import UserError from 'core/lib/user-error';
* @property {Boolean} loggedIn Whether the user is currently logged
*/
export default class Auth {
constructor($http, $q, vnApp, $translate, $state, $transitions, $window, vnToken, vnModules, aclService) {
constructor($http, $q, $state, $transitions, $window, vnToken, vnModules) {
Object.assign(this, {
$http,
$q,
vnApp,
$translate,
$state,
$transitions,
$window,
vnToken,
vnModules,
aclService,
loggedIn: false
});
}
@ -111,13 +108,11 @@ export default class Auth {
headers: {Authorization: json.data.token}
}).then(({data}) => {
this.vnToken.set(json.data.token, data.multimediaToken.id, now, json.data.ttl, remember);
this.loadAcls().then(() => {
let continueHash = this.$state.params.continue;
if (continueHash)
this.$window.location = continueHash;
else
this.$state.go('home');
});
let continueHash = this.$state.params.continue;
if (continueHash)
this.$window.location = continueHash;
else
this.$state.go('home');
}).catch(() => {});
}
@ -131,7 +126,7 @@ export default class Auth {
this.vnToken.unset();
this.loggedIn = false;
this.vnModules.reset();
this.aclService.reset();
this.vnModules.aclService.reset();
this.$state.go('login');
return promise;