Ну, в общем то вот:
let authorizate = await fetch('адрес-обработчика', {
method: 'POST',
headers: {
'cache-control' : 'no-cache',
'Content-Type' : 'application/json'
},
body: JSON.stringify( { email:
authData.email, password: authData.password } )
}).then(response => {
if (response.ok) {
return response.json()
} else {
throw Error('Ошибка авторизации: ', response.status, response.statusText)
}
})
ОШИБКИ:
Access to fetch at 'адрес-обработчика' from origin '
http://192.168.1.178:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
POST "адрес-обработчика" net::ERR_FAILED
Uncaught (in promise) TypeError: Failed to fetch