Commit 625cf4b 1 parent 5c85341 commit 625cf4b Copy full SHA for 625cf4b
File tree 3 files changed +1
-28
lines changed
3 files changed +1
-28
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import {
13
13
checkErrors ,
14
14
defaultValues ,
15
15
emptyValues ,
16
- refreshStudioCSRFToken ,
17
16
teamSize
18
17
} from './utils'
19
18
import { studioContactUsApi } from '../../utils/externalUrls'
@@ -116,12 +115,10 @@ const RequestAQuoteForm = ({
116
115
}
117
116
118
117
try {
119
- const csrfToken = await refreshStudioCSRFToken ( )
120
118
const response = await fetch ( studioContactUsApi , {
121
119
method : `POST` ,
122
120
headers : {
123
- 'Content-Type' : `application/json` ,
124
- 'X-CsrfToken' : csrfToken
121
+ 'Content-Type' : `application/json`
125
122
} ,
126
123
credentials : `include` ,
127
124
mode : `cors` ,
Original file line number Diff line number Diff line change 1
- import { studioRefreshCsfrApi } from '../../utils/externalUrls'
2
-
3
1
export type FormField =
4
2
| 'name'
5
3
| 'company'
@@ -82,24 +80,3 @@ export const checkErrors = (
82
80
83
81
return { hasError, newErrors }
84
82
}
85
-
86
- function getCookie ( name : string ) {
87
- let cookieValue = null
88
- if ( document . cookie && document . cookie !== `` ) {
89
- const cookies = document . cookie . split ( `;` )
90
- for ( let i = 0 ; i < cookies . length ; i ++ ) {
91
- const cookie = cookies [ i ] . trim ( )
92
- // Does this cookie string begin with the name we want?
93
- if ( cookie . substring ( 0 , name . length + 1 ) === name + `=` ) {
94
- cookieValue = decodeURIComponent ( cookie . substring ( name . length + 1 ) )
95
- break
96
- }
97
- }
98
- }
99
- return cookieValue
100
- }
101
-
102
- export const refreshStudioCSRFToken = async ( ) => {
103
- await fetch ( studioRefreshCsfrApi )
104
- return getCookie ( `csrftoken` ) || ``
105
- }
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ export const studioUrl = 'https://studio.datachain.ai'
4
4
5
5
// Studio API Urls
6
6
const studioApi = `${ studioUrl } /api`
7
- export const studioRefreshCsfrApi = `${ studioApi } /refresh-csrf`
8
7
export const studioContactUsApi = `${ studioApi } /contacts`
9
8
10
9
// Github Urls
You can’t perform that action at this time.
0 commit comments