Added tests for user-info component

This commit is contained in:
Vito Albano
2016-09-30 00:54:23 +01:00
parent d946532f14
commit 336ffe75d8
8 changed files with 452 additions and 31 deletions

View File

@@ -82,6 +82,7 @@ export class AlfrescoAuthenticationService {
* @returns {Observable<R>|Observable<T>}
*/
login(username: string, password: string): Observable<{ type: string, ticket: any }> {
this.removeTicket();
return Observable.fromPromise(this.callApiLogin(username, password))
.map((response: any) => {
this.saveTickets();
@@ -191,6 +192,20 @@ export class AlfrescoAuthenticationService {
}
}
/**
* The method return true if user is logged in on ecm provider
*/
public isEcmLoggedIn() {
return this.alfrescoApi.ecmAuth && !!this.alfrescoApi.ecmAuth.isLoggedIn();
}
/**
* The method return true if user is logged in on bpm provider
*/
public isBpmLoggedIn() {
return this.alfrescoApi.bpmAuth && !!this.alfrescoApi.bpmAuth.isLoggedIn();
}
/**
* The method write the error in the console browser
* @param error