mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
demo shell host setting component login redirect after setting
This commit is contained in:
parent
4d4a8d2864
commit
fa6a6725cf
@ -1 +1,2 @@
|
||||
This component is only for internal use
|
||||
<adf-host-settings (cancel)="onCancel()" (success)="onSuccess()" (error)="onError($event)"></adf-host-settings>
|
||||
|
@ -34,10 +34,10 @@ export class SettingsComponent {
|
||||
}
|
||||
|
||||
onCancel() {
|
||||
this.router.navigate(['/']);
|
||||
this.router.navigate(['/login']);
|
||||
}
|
||||
|
||||
onSuccess() {
|
||||
this.router.navigate(['/']);
|
||||
this.router.navigate(['/login']);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ Last reviewed: 2018-06-13
|
||||
|
||||
# Host settings component
|
||||
|
||||
`This component Note this comonent is not meant to be used in production`
|
||||
`This component Note this component is not meant to be used in production`
|
||||
Validates the URLs for ACS and APS and saves them in the user's local storage
|
||||
|
||||

|
||||
|
@ -22,11 +22,11 @@ import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { CookieService } from './cookie.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { RedirectionModel } from '../models/redirection.model';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
import 'rxjs/add/observable/fromPromise';
|
||||
import 'rxjs/add/operator/catch';
|
||||
import 'rxjs/add/observable/throw';
|
||||
import { RedirectionModel } from '../models/redirection.model';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
|
||||
const REMEMBER_ME_COOKIE_KEY = 'ALFRESCO_REMEMBER_ME';
|
||||
const REMEMBER_ME_UNTIL = 1000 * 60 * 60 * 24 * 30 ;
|
||||
@ -116,9 +116,10 @@ export class AuthenticationService {
|
||||
* @returns Response event called when logout is complete
|
||||
*/
|
||||
logout() {
|
||||
this.removeTicket();
|
||||
|
||||
return Observable.fromPromise(this.callApiLogout())
|
||||
.do(response => {
|
||||
this.removeTicket();
|
||||
this.onLogout.next(response);
|
||||
return response;
|
||||
})
|
||||
|
@ -19,6 +19,7 @@ import { Component, EventEmitter, Output, ViewEncapsulation, OnInit, Input } fro
|
||||
import { Validators, FormGroup, FormBuilder, AbstractControl, FormControl } from '@angular/forms';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
import { AuthenticationService } from '../services/authentication.service';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { OauthConfigModel } from '../models/oauth-config.model';
|
||||
|
||||
@ -66,6 +67,7 @@ export class HostSettingsComponent implements OnInit {
|
||||
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private storageService: StorageService,
|
||||
private authenticationService: AuthenticationService,
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private appConfig: AppConfigService) {
|
||||
}
|
||||
@ -176,7 +178,11 @@ export class HostSettingsComponent implements OnInit {
|
||||
this.storageService.setItem(AppConfigValues.AUTHTYPE, values.authType);
|
||||
|
||||
this.alfrescoApiService.reset();
|
||||
this.authenticationService.logout().subscribe(() => {
|
||||
this.success.emit(true);
|
||||
}, () => {
|
||||
this.success.emit(true);
|
||||
});
|
||||
}
|
||||
|
||||
private saveOAuthValues(values: any) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user