You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is cors policy restriction when used on frappe version-13, cors access in site_config has been set and javascript FETCH works well but renovation core is restricted., error below
Access to XMLHttpRequest at 'https://testbin.frappe.com/' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field x-client-site is not allowed by Access-Control-Allow-Headers in preflight response.
This error occurred in a VUEJS app.
SAMPLE code:
(async () => {
await renovation.init(backend, hostURL, "test-site")
// renovation.enableJWT(true)
const authResponse = await renovation.auth.login({
email: "administrator",
password: "password"
});
console.log("Successful login", authResponse.data.currentUser);
})();
// above did had cors policy issue, but below worked fine.
@mymi14s
You can try these 2 things
=> if your using renovation_core frappe app please use branch version-13
=> try setting in your site_config allow_cors
There is cors policy restriction when used on frappe version-13, cors access in site_config has been set and javascript FETCH works well but renovation core is restricted., error below
Access to XMLHttpRequest at 'https://testbin.frappe.com/' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field x-client-site is not allowed by Access-Control-Allow-Headers in preflight response.
This error occurred in a VUEJS app.
SAMPLE code:
(async () => {
await renovation.init(backend, hostURL, "test-site")
// renovation.enableJWT(true)
const authResponse = await renovation.auth.login({
email: "administrator",
password: "password"
});
console.log("Successful login", authResponse.data.currentUser);
})();
// above did had cors policy issue, but below worked fine.
fetch('https://gherp.com/api/method/login', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
usr: 'administrator',
pwd: 'password'
})
})
.then(r => r.json())
The text was updated successfully, but these errors were encountered: