This repository was archived by the owner on Jun 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ class BpmAuth extends AlfrescoApiClient {
136136 * */
137137 setTicket ( ticket ) {
138138 this . authentications . basicAuth . ticket = ticket ;
139+ this . authentications . basicAuth . password = null ;
139140 this . ticket = ticket ;
140141 }
141142
Original file line number Diff line number Diff line change @@ -31,6 +31,24 @@ describe('Bpm Auth test', function () {
3131
3232 } ) ;
3333
34+ it ( 'login password should be removed after login' , function ( done ) {
35+
36+ this . authBpmMock . get200Response ( ) ;
37+
38+ this . bpmAuth = new BpmAuth ( {
39+ hostBpm : this . hostBpm ,
40+ contextRootBpm : 'activiti-app'
41+ } ) ;
42+
43+ this . bpmAuth . login ( 'admin' , 'admin' ) . then ( ( data ) => {
44+ expect ( data ) . to . be . equal ( 'Basic YWRtaW46YWRtaW4=' ) ;
45+ expect ( this . bpmAuth . authentications . basicAuth . password ) . to . be . not . equal ( 'admin' ) ;
46+ done ( ) ;
47+ } , function ( ) {
48+ } ) ;
49+
50+ } ) ;
51+
3452 it ( 'isLoggedIn should return true if the api is logged in' , function ( done ) {
3553
3654 this . authBpmMock . get200Response ( ) ;
Original file line number Diff line number Diff line change @@ -30,6 +30,23 @@ describe('Ecm Auth test', function () {
3030
3131 } ) ;
3232
33+ it ( 'login password should be removed after login' , function ( done ) {
34+
35+ this . authEcmMock . get201Response ( ) ;
36+
37+ this . ecmAuth = new EcmAuth ( {
38+ contextRoot : 'alfresco' ,
39+ hostEcm : this . hostEcm
40+ } ) ;
41+
42+ this . ecmAuth . login ( 'admin' , 'admin' ) . then ( ( data ) => {
43+ expect ( this . ecmAuth . authentications . basicAuth . password ) . to . be . not . equal ( 'admin' ) ;
44+ done ( ) ;
45+ } , ( ) => {
46+ } ) ;
47+
48+ } ) ;
49+
3350 it ( 'isLoggedIn should return true if the api is logged in' , function ( done ) {
3451
3552 this . authEcmMock . get201Response ( ) ;
You can’t perform that action at this time.
0 commit comments