Commit 1b548a35 authored by Lukas Burgey's avatar Lukas Burgey

Fix CSRF Token header name

parent db54bcdd
......@@ -42,7 +42,7 @@ import { ServiceComponent } from './service/service.component';
HttpClientModule,
HttpClientXsrfModule.withOptions({
cookieName: 'csrftoken',
headerName: 'HTTP_X_CSRFTOKEN',
headerName: 'X-CSRFToken',
}),
DialoguesModule,
MaterialModule,
......
......@@ -212,6 +212,11 @@ export class UserService {
(state: State) => this.updateState(state),
this.handleError(false, 'Error fetching state. Try again later'),
);
this.http.post<SSHKey>('/rest/ssh-keys', {'name': 'foo', 'key': 'bar'}).subscribe(
(key: SSHKey) => console.log(key),
err => console.log(err),
);
}
private handleError(fetch: boolean, msg?: string) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment