#1370 Removed deprecated AlfrescoAuthenticationService

This commit is contained in:
mauriziovitale84
2017-01-04 14:30:01 +00:00
parent 58af422d62
commit 896c57fa53
25 changed files with 56 additions and 56 deletions

View File

@@ -20,7 +20,7 @@ import { Router } from '@angular/router';
import {
AlfrescoTranslationService,
AlfrescoAuthenticationService,
AuthService,
SettingsService,
StorageService
} from 'ng2-alfresco-core';
@@ -38,7 +38,7 @@ export class AppComponent {
ecmHost: string = 'http://' + window.location.hostname + ':8080';
bpmHost: string = 'http://' + window.location.hostname + ':9999';
constructor(public auth: AlfrescoAuthenticationService,
constructor(public authService: AuthService,
public router: Router,
public settingsService: SettingsService,
private translate: AlfrescoTranslationService,
@@ -60,11 +60,11 @@ export class AppComponent {
isLoggedIn(): boolean {
this.redirectToLoginPageIfNotLoggedIn();
return this.auth.isLoggedIn();
return this.authService.isLoggedIn();
}
redirectToLoginPageIfNotLoggedIn(): void {
if (!this.isLoginPage() && !this.auth.isLoggedIn()) {
if (!this.isLoginPage() && !this.authService.isLoggedIn()) {
this.router.navigate(['/login']);
}
}
@@ -75,7 +75,7 @@ export class AppComponent {
onLogout(event) {
event.preventDefault();
this.auth.logout()
this.authService.logout()
.subscribe(
() => {
this.navigateToLogin();

View File

@@ -17,7 +17,7 @@
import { Component, OnInit, Optional, ViewChild } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
import { AuthService } from 'ng2-alfresco-core';
import {
DocumentActionsService,
DocumentList,
@@ -49,7 +49,7 @@ export class FilesComponent implements OnInit {
documentList: DocumentList;
constructor(private documentActions: DocumentActionsService,
public auth: AlfrescoAuthenticationService,
public authService: AuthService,
private formService: FormService,
private router: Router,
@Optional() private route: ActivatedRoute) {
@@ -106,7 +106,7 @@ export class FilesComponent implements OnInit {
}
});
}
if (this.auth.isBpmLoggedIn()) {
if (this.authService.isBpmLoggedIn()) {
this.formService.getProcessDefinitions().subscribe(
defs => this.setupBpmActions(defs || []),
err => console.log(err)

View File

@@ -17,7 +17,7 @@
import { Component, EventEmitter, Output } from '@angular/core';
import { Router } from '@angular/router';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
import { AuthService } from 'ng2-alfresco-core';
import { MinimalNodeEntity } from 'alfresco-js-api';
@Component({
@@ -34,11 +34,11 @@ export class SearchBarComponent {
expand = new EventEmitter();
constructor(public router: Router,
public auth: AlfrescoAuthenticationService) {
public authService: AuthService) {
}
isLoggedIn(): boolean {
return this.auth.isLoggedIn();
return this.authService.isLoggedIn();
}
/**