Skip to content

Commit

Permalink
feat(http): add option to disable csrf token handling (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiaking committed Jan 10, 2024
1 parent 956709d commit 97cb8f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/http/Http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import { stringify } from 'qs'

export class Http {
static base: string | undefined = undefined
static xsrfUrl = '/api/csrf-cookie'
static xsrfUrl: string | false = '/api/csrf-cookie'

private async ensureXsrfToken(): Promise<string | undefined> {
if (!Http.xsrfUrl) {
return undefined
}

let xsrfToken = parseCookie(document.cookie)['XSRF-TOKEN']

if (!xsrfToken) {
Expand Down

0 comments on commit 97cb8f5

Please sign in to comment.