origin header

This commit is contained in:
kurpfish 2021-08-04 17:48:20 +03:00
parent 9f71cda86b
commit 937a78b04f

View File

@ -2,7 +2,8 @@ export const fetchProfile = async (link, index) => {
try { try {
const response = await fetch(`${link}${index}`, { const response = await fetch(`${link}${index}`, {
headers: { headers: {
'Authorization': `Bearer ${localStorage.getItem('auth_token')}` 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`,
'Origin': `${baseURL}`,
} }
}) })
let data = await response.json() let data = await response.json()
@ -15,7 +16,8 @@ export const fetchSkills = async (link) => {
try { try {
const response = await fetch(link, { const response = await fetch(link, {
headers: { headers: {
'Authorization': `Bearer ${localStorage.getItem('auth_token')}` 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`,
'Origin': `${baseURL}`,
} }
}) })
let data = await response.json() let data = await response.json()
@ -28,7 +30,8 @@ export const fetchItemsForId = async (link, id) => {
try { try {
const response = await fetch(`${link}${id}`, { const response = await fetch(`${link}${id}`, {
headers: { headers: {
'Authorization': `Bearer ${localStorage.getItem('auth_token')}` 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`,
'Origin': `${baseURL}`,
} }
}) })
let data = await response.json() let data = await response.json()
@ -43,6 +46,7 @@ export const fetchForm = async (link, info) => {
method: 'POST', method: 'POST',
headers: { headers: {
'Authorization': `Bearer ${localStorage.getItem('auth_token')}`, 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`,
'Origin': `${baseURL}`,
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
}, },
body: info body: info