ERP-Ukraine / odoo-rpc-dart

Odoo RPC Library for Dart
MIT License
43 stars 32 forks source link

Flutter Web can't read the session id form set-cookie #17

Closed saleh-aleid closed 2 years ago

saleh-aleid commented 2 years ago

Dears,

Please you can help me how i can read the session form response using flutter web.

lem8r commented 2 years ago

Hi,

RPC calls via web client (dart js) that is hosted on separate domain will not work due to CORS requests currently are not correctly handled by Odoo. See https://github.com/odoo/odoo/pull/37853 for the details.

excellencemichel commented 2 years ago

When we add this plugin it will work for fine ? https://github.com/odoo/odoo/files/3779626/web_session_cors.zip

excellencemichel commented 2 years ago

I try to implemente on my Odoo V14 instance here is what is my issues when I use your addon from you: https://github.com/odoo/odoo/files/3779626/web_session_cors.zip On the flutter error message XMLHttpRequest error. On the Odoo server log : <function Session.authenticate at 0x7fce2e9a59d0>, /web/session/authenticate: Function declared as capable of handling request of type 'json' but called with a request of type 'http'

Do you know I how can I resolve this problem ? Please help me I am on the jobs task I dont have any solution now

lem8r commented 2 years ago

web_session_cors was written for v12. It may not work for v14.

excellencemichel commented 2 years ago

Okay, thank you for your reply. Can you help me to fixe this please ?

lem8r commented 2 years ago

Sorry, I have no spare time for this.

I don't know why you eve need this. Android and iOS apps are working fine. There is issue with flutter for web. You can serve if from same domain as your odoo instance is running to avoid cors error.

Personally I don't understand why using external web app to access Odoo data if you can do it directly within Odoo. Get owl and mdc components, serve it from own controller similar as it was done for awesome timesheets app.

Elblassy commented 2 years ago

your module doesn't work with odoo v12 also it didn't respond with session id !

lem8r commented 2 years ago

Hi,

If you're using Flutter for web RPC calls to Odoo server will not work due to security restrictions on Odoo side.