This repository was archived by the owner on Jun 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +36
-3
lines changed
Expand file tree Collapse file tree 2 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -452,9 +452,9 @@ export class AlfrescoApi implements Emitter, AlfrescoApiType {
452452 if ( this . isBpmConfiguration ( ) ) {
453453 return this . processAuth . isLoggedIn ( ) ;
454454 } else if ( this . isEcmConfiguration ( ) ) {
455- return this . contentAuth . isLoggedIn ( ) ;
455+ return this . config . withCredentials ? true : this . contentAuth . isLoggedIn ( ) ;
456456 } else if ( this . isEcmBpmConfiguration ( ) ) {
457- return this . contentAuth . isLoggedIn ( ) && this . processAuth . isLoggedIn ( ) ;
457+ return this . config . withCredentials ? true : ( this . contentAuth . isLoggedIn ( ) && this . processAuth . isLoggedIn ( ) ) ;
458458 } else {
459459 return false ;
460460 }
@@ -477,7 +477,7 @@ export class AlfrescoApi implements Emitter, AlfrescoApiType {
477477 if ( this . isOauthConfiguration ( ) ) {
478478 return this . oauth2Auth . isLoggedIn ( ) ;
479479 } else {
480- return this . contentAuth . isLoggedIn ( ) ;
480+ return this . config . withCredentials ? true : this . contentAuth . isLoggedIn ( ) ;
481481 }
482482 }
483483 return false ;
Original file line number Diff line number Diff line change @@ -96,6 +96,39 @@ describe('Basic configuration test', () => {
9696 expect ( alfrescoJsApi . processClient . isWithCredentials ( ) ) . equal ( true ) ;
9797 } ) ;
9898
99+ it ( 'should withCredentials true parameter with hostEcm should be reflected in isEcmLoggedIn' , ( ) => {
100+ const hostEcm = 'http://127.0.0.1:8080' ;
101+ const alfrescoJsApi = new AlfrescoApi ( {
102+ hostEcm,
103+ provider : 'ECM' ,
104+ withCredentials : true
105+ } as AlfrescoApiConfig ) ;
106+
107+ expect ( alfrescoJsApi . isEcmLoggedIn ( ) ) . equal ( true ) ;
108+ } ) ;
109+
110+ it ( 'should withCredentials true parameter with hostEcm should be reflected in isLoggedIn' , ( ) => {
111+ const hostEcm = 'http://127.0.0.1:8080' ;
112+ const alfrescoJsApi = new AlfrescoApi ( {
113+ hostEcm,
114+ provider : 'ECM' ,
115+ withCredentials : true
116+ } as AlfrescoApiConfig ) ;
117+
118+ expect ( alfrescoJsApi . isLoggedIn ( ) ) . equal ( true ) ;
119+ } ) ;
120+
121+ it ( 'should withCredentials true parameter with ALL provider should be reflected in isLoggedIn' , ( ) => {
122+ const hostEcm = 'http://127.0.0.1:8080' ;
123+ const alfrescoJsApi = new AlfrescoApi ( {
124+ hostEcm,
125+ provider : 'ALL' ,
126+ withCredentials : true
127+ } as AlfrescoApiConfig ) ;
128+
129+ expect ( alfrescoJsApi . isLoggedIn ( ) ) . equal ( true ) ;
130+ } ) ;
131+
99132 it ( 'should withCredentials false parameter should be reflected in the clients' , ( ) => {
100133 const config = {
101134 hostEcm : 'http://testServer.com:1616' ,
You can’t perform that action at this time.
0 commit comments