#6930 - Use ScopedToken when share Multimedia files #2094
|
@ -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');
|
||||
}
|
||||
});
|
||||
jsegarra marked this conversation as resolved
Outdated
|
||||
}
|
||||
|
||||
loadAcls() {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Las llamadas al back pueden hacerse en paralelo en lugar de secuencial
Me parece que tiene mas lógica hacerlo sencuencial porque es la misma manera de proceder para obtener el token con accesScope, es decir,
Puedo probar a implementar $q.all([promises])
Corregido
f2f6e7be0b