mirror of
https://github.com/dkmstr/openuds-gui.git
synced 2024-10-26 08:55:23 +03:00
added crsftoken from cookie
This commit is contained in:
parent
2b9575c3bc
commit
d6407aefa1
@ -4,10 +4,8 @@
|
||||
"license": "BSD-3-Clause",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"f4xstart": "ng serve --host 0.0.0.0 --port 9000 --proxy-config proxy.conf.json",
|
||||
"f4xbuild": "ng build --configuration production --output-hashing=none --aot=false --delete-output-path --build-optimizer=false --deploy-url /uds/res/modern/ --base-href /uds/page && yarn postbuild",
|
||||
"start": "ng serve --host 0.0.0.0 --port 9000 --proxy-config proxy.conf.json",
|
||||
"build": "ng build --configuration production --output-hashing=none --aot --delete-output-path --build-optimizer --deploy-url /uds/res/modern/ --base-href /uds/page",
|
||||
"start": "NODE_OPTIONS=--openssl-legacy-provider ng serve --host 0.0.0.0 --port 9000 --proxy-config proxy.conf.json",
|
||||
"build": "NODE_OPTIONS=--openssl-legacy-provider ng build --configuration production --output-hashing=none --aot --delete-output-path --build-optimizer --deploy-url /uds/res/modern/ --base-href /uds/page",
|
||||
"postbuild": "python3 toUDS.py",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
|
@ -29,7 +29,10 @@ export class LoginComponent implements OnInit {
|
||||
form.action = this.api.config.urls.login;
|
||||
const input = document.getElementById('token') as HTMLInputElement;
|
||||
input.name = this.api.csrfField;
|
||||
input.value = this.api.csrfToken;
|
||||
|
||||
// Extract csrftoken from cookie
|
||||
const cookie = document.cookie.split(';').find((c) => c.trim().startsWith('csrftoken='));
|
||||
input.value = cookie.split('=')[1];
|
||||
|
||||
this.auth = document.getElementById('authenticator') as HTMLInputElement;
|
||||
if (this.auths.length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user