diff --git a/front/core/services/auth.js b/front/core/services/auth.js index a734e076e8..e51a2ff123 100644 --- a/front/core/services/auth.js +++ b/front/core/services/auth.js @@ -98,17 +98,20 @@ export default class Auth { } logout() { - let promise = this.$http.post('VnUsers/logout', null, { - headers: {Authorization: this.vnToken.token} - }).catch(() => {}); + this.$http.post('VnUsers/logoutMultimedia', null, {headers: {'Authorization': this.vnToken.tokenMultimedia}, + }).then(({data}) => { + if (data) { + this.$http.post('VnUsers/logout', null, { + headers: {Authorization: this.vnToken.token} + }).catch(() => {}); - this.vnToken.unset(); - this.loggedIn = false; - this.vnModules.reset(); - this.aclService.reset(); - this.$state.go('login'); - - return promise; + this.vnToken.unset(); + this.loggedIn = false; + this.vnModules.reset(); + this.aclService.reset(); + this.$state.go('login'); + } + }); } loadAcls() { diff --git a/front/core/services/interceptor.js b/front/core/services/interceptor.js index 0c3253c693..90d813ed43 100644 --- a/front/core/services/interceptor.js +++ b/front/core/services/interceptor.js @@ -19,7 +19,7 @@ function interceptor($q, vnApp, $translate) { if (config.url.charAt(0) !== '/' && apiPath) config.url = `${apiPath}${config.url}`; - if (token) + if (token && !config.headers.Authorization) config.headers.Authorization = token; if ($translate.use()) config.headers['Accept-Language'] = $translate.use();