Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
25656 Lượt xem

Hi,

I am trying to call odoo service using AngularJS. But calling the http://<servername>:<port>/web/session/authenticate (POST method), I got the error: Invalid CSRF Token

I read that I have to call the same url, use GET and X-CSRF-TOKEN=FETCH in the header in order to get the token then re-use it. But I have the same error.

Any idea on how I can solve "Invalid CSRF Token" ? 

Ảnh đại diện
Huỷ bỏ

In Controller pass csrf=False

add in @http.route(['/your_url'], type='http', auth="public", website=True, csrf=False)

 

Câu trả lời hay nhất

Call this method (GET) http://<servername>:<port>/web/login


you get CSRF token from this link :)

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I have the same issue.

After running migrate script of openupgrade from v8 to v9,

When selecting the migrated database to login in, there is the following error message.

Bad Request

Session expired (invalid CSRF token)
,   

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
5
thg 6 22
36103
1
thg 10 25
414
1
thg 10 23
2122
1
thg 10 23
3640
4
thg 12 22
9307