7525-devToTest #2542
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue