mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
This commit is contained in:
@@ -3,3 +3,7 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.mdl-layout-title{
|
||||
font-size: 17px;
|
||||
}
|
||||
|
@@ -61,6 +61,11 @@
|
||||
<input type="text" class="mdl-textfield__input" id="bpmHost" data-automation-id="bpmHost"
|
||||
tabindex="1" (change)="onChangeBPMHost($event)" value="{{bpmHost}}"/>
|
||||
</nav>
|
||||
<span class="mdl-layout-title">CSRF Token Disabled</span>
|
||||
<nav class="mdl-navigation">
|
||||
<input type="text" class="mdl-textfield__input" id="csrfDisabled" data-automation-id="csrfDisabled"
|
||||
tabindex="1" (change)="onChangeCsrf($event)" value="{{csrfDisabled}}"/>
|
||||
</nav>
|
||||
</div>
|
||||
<main class="mdl-layout__content">
|
||||
<div class="page-content">
|
||||
|
@@ -37,6 +37,7 @@ export class AppComponent {
|
||||
|
||||
ecmHost: string = 'http://' + window.location.hostname + ':8080';
|
||||
bpmHost: string = 'http://' + window.location.hostname + ':9999';
|
||||
csrfDisabled: boolean = false;
|
||||
|
||||
constructor(public auth: AlfrescoAuthenticationService,
|
||||
public router: Router,
|
||||
@@ -44,6 +45,7 @@ export class AppComponent {
|
||||
public alfrescoSettingsService: AlfrescoSettingsService) {
|
||||
this.setEcmHost();
|
||||
this.setBpmHost();
|
||||
this.setCsrfToken();
|
||||
|
||||
this.translate = translate;
|
||||
this.translate.addTranslationFolder();
|
||||
@@ -63,6 +65,13 @@ export class AppComponent {
|
||||
localStorage.setItem(`bpmHost`, this.bpmHost);
|
||||
}
|
||||
|
||||
public onChangeCsrf(event: KeyboardEvent): void {
|
||||
console.log((<HTMLInputElement>event.target).value);
|
||||
this.csrfDisabled = !!(<HTMLInputElement>event.target).value;
|
||||
this.alfrescoSettingsService.csrfDisabled = this.csrfDisabled;
|
||||
localStorage.setItem(`csrfDisabled`, this.csrfDisabled.toString());
|
||||
}
|
||||
|
||||
isLoggedIn(): boolean {
|
||||
return this.auth.isLoggedIn();
|
||||
}
|
||||
@@ -120,4 +129,13 @@ export class AppComponent {
|
||||
this.alfrescoSettingsService.bpmHost = this.bpmHost;
|
||||
}
|
||||
}
|
||||
|
||||
private setCsrfToken() {
|
||||
if (localStorage.getItem(`csrfDisabled`)) {
|
||||
this.alfrescoSettingsService.bpmHost = localStorage.getItem(`csrfDisabled`);
|
||||
this.csrfDisabled = !!localStorage.getItem(`csrfDisabled`);
|
||||
} else {
|
||||
this.alfrescoSettingsService.csrfDisabled = this.csrfDisabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user