mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[MNT-24628] Handle difference between config object ticket and browser storage ticket (#10270)
* [MNT-24628] Handle difference between config object ticket and browser storage ticket * [MNT-24628] Add unit tests * [MNT-24628] Added null/undefined checks
This commit is contained in:
@@ -243,10 +243,18 @@ export class AlfrescoApiClient implements ee.Emitter, LegacyHttpClient {
|
||||
|
||||
if (ticket) {
|
||||
return ticketParam + ticket;
|
||||
} else if (this.config.ticketEcm) {
|
||||
return ticketParam + this.config.ticketEcm;
|
||||
} else if (this.storage.getItem('ticket-ECM')) {
|
||||
return ticketParam + this.storage.getItem('ticket-ECM');
|
||||
} else {
|
||||
const ticketConfig = this.config.ticketEcm;
|
||||
const ticketStorage = this.storage.getItem('ticket-ECM');
|
||||
|
||||
if (ticketConfig && ticketStorage && ticketConfig !== ticketStorage) {
|
||||
this.emit('ticket_mismatch', { newTicket: ticketStorage });
|
||||
return ticketParam + ticketStorage;
|
||||
} else if (ticketConfig) {
|
||||
return ticketParam + ticketConfig;
|
||||
} else if (ticketStorage) {
|
||||
return ticketParam + ticketStorage;
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
|
Reference in New Issue
Block a user