Skip to content

Commit 1c4810a

Browse files
committed
Make fmt on js files
1 parent e798e11 commit 1c4810a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

site/src/api/api.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ export const hardCodedCSRFCookie = (): string => {
1010
// each document request. For local development, we don't use the Go webserver for static files,
1111
// so this is the 'hack' to make local development work with remote apis.
1212
// The CSRF cookie for this token is "JXm9hOUdZctWt0ZZGAy9xiS/gxMKYOThdxjjMnMUyn4="
13-
const csrfToken = "KNKvagCBEHZK7ihe2t7fj6VeJ0UyTDco1yVUJE8N06oNqxLu5Zx1vRxZbgfC0mJJgeGkVjgs08mgPbcWPBkZ1A=="
13+
const csrfToken =
14+
"KNKvagCBEHZK7ihe2t7fj6VeJ0UyTDco1yVUJE8N06oNqxLu5Zx1vRxZbgfC0mJJgeGkVjgs08mgPbcWPBkZ1A=="
1415
axios.defaults.headers.common["X-CSRF-TOKEN"] = csrfToken
1516
return csrfToken
1617
}
1718

1819
// Always attach CSRF token to all requests
1920
const token = document.head.querySelector('meta[property="csrf-token"]')
2021
if (token !== null && token.getAttribute("content") !== null) {
21-
if(process.env.NODE_ENV === "development") {
22+
if (process.env.NODE_ENV === "development") {
2223
// Development mode uses a hard-coded CSRF token
2324
axios.defaults.headers.common["X-CSRF-TOKEN"] = hardCodedCSRFCookie()
2425
token.setAttribute("content", hardCodedCSRFCookie())
@@ -27,7 +28,7 @@ if (token !== null && token.getAttribute("content") !== null) {
2728
}
2829
} else {
2930
// Do not write error logs if we are in a FE unit test.
30-
if(process.env.JEST_WORKER_ID === undefined) {
31+
if (process.env.JEST_WORKER_ID === undefined) {
3132
console.error("CSRF token not found")
3233
}
3334
}

site/webpack.dev.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ const config: Configuration = {
5151
},
5252
devMiddleware: {
5353
publicPath: "/",
54-
headers: {"Set-Cookie":"csrf_token=JXm9hOUdZctWt0ZZGAy9xiS/gxMKYOThdxjjMnMUyn4=; Path=/; HttpOnly; SameSite=Lax"}
54+
headers: {
55+
"Set-Cookie":
56+
"csrf_token=JXm9hOUdZctWt0ZZGAy9xiS/gxMKYOThdxjjMnMUyn4=; Path=/; HttpOnly; SameSite=Lax",
57+
},
5558
},
5659
headers: {
5760
"Access-Control-Allow-Origin": "*",

0 commit comments

Comments
 (0)