Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit ff740e0

Browse files
eromanoDenys Vuika
authored andcommitted
clean after login bpm (#183)
1 parent 92458fc commit ff740e0

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

src/bpmAuth.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

test/bpmAuth.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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();

test/ecmAuth.spec.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)