We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c774fcc commit 51d856eCopy full SHA for 51d856e
site/src/api/api.ts
@@ -6,7 +6,7 @@ import * as TypesGen from "./typesGenerated"
6
7
// Always attach CSRF token to all requests
8
const token = document.head.querySelector('meta[property="csrf-token"]')
9
-if (token) {
+if (token !== null && token.getAttribute("content") !== null) {
10
axios.defaults.headers.common["X-CSRF-TOKEN"] = token.getAttribute("content") ?? ""
11
} else {
12
console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token")
0 commit comments