Add BPM user logged in

This commit is contained in:
Vito Albano
2016-09-19 11:53:55 +01:00
parent 18fbdb75d0
commit 86e5b3f1e5
6 changed files with 288 additions and 36 deletions

View File

@@ -11,7 +11,7 @@ import {
@Component({
selector: 'my-app',
template: `<h4>START</h4><ng2-alfresco-userinfo></ng2-alfresco-userinfo>`,
template: `<h4>START</h4><ng2-alfresco-userinfo [userEmail]="'test'"></ng2-alfresco-userinfo>`,
directives: [ UserInfoComponent ],
providers: [AlfrescoAuthenticationService, AlfrescoSettingsService]
})
@@ -20,36 +20,31 @@ import {
class UserInfoDemo implements OnInit {
private authenticated: boolean;
private ticket: string;
// private ecmHost: string;
private token: any;
constructor(private authService: AlfrescoAuthenticationService,
private settingsService: AlfrescoSettingsService) {
this.settingsService.setProviders('ECM');
this.settingsService.setProviders('ALL');
}
public ngOnInit(): void {
this.login();
}
login() {
this.authService.login('test', 'test').subscribe(
ticket => {
console.log(ticket);
this.ticket = this.authService.getTicketEcm();
this.authenticated = true;
},
error => {
console.log(error);
this.authenticated = false;
});
}
login() {
this.authService.login('test', 'test').subscribe(
token => {
console.log(token);
this.token = token;
this.authenticated = true;
},
error => {
console.log(error);
this.authenticated = false;
});
}
}
bootstrap(UserInfoDemo, [
UserInfoComponent,
HTTP_PROVIDERS,