Skip to Content
Menu
This question has been flagged
3 Replies
10458 Views

I've used a module who give me a Rest Api, so It works perfectly when I'm using postman but when I using vue it says

 Access to XMLHttpRequest at 'http://localhost:8069/web/session/authenticate' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I want to allow the rest request

Avatar
Discard
Best Answer

I have the same problem tried nearly everything. I even tried to use serverside npm odoo-xmlrpc calls. This isn't working at all.
The Vue app is the problem....


To fix this issue build a node app with express that calls the api and then implement that in your vue app.

Avatar
Discard
Best Answer

Hi there, 


I also use cors="*" however with authentication it's import to specify the client domain. I am also struggling to get this to work. If you are still working on it, let me know. My email is elin44@gmail.com


Yi

Avatar
Discard
Best Answer

Pass cors='*' in your controller method like below


@http.route('/testme', type='http', auth='none', csrf=False, cors='*')
def max_upload_size(self, **kw):
Avatar
Discard