From 5775ea3c3cb95d0abb28ee3e5555999b6f9f00c9 Mon Sep 17 00:00:00 2001 From: Simone Rubino Date: Mon, 5 Aug 2024 11:54:14 +0200 Subject: [PATCH] [FIX] website_require_login: Allow RPC JSON/XML RPC should not be redirected to login. --- website_require_login/models/ir_http.py | 2 ++ website_require_login/tests/test_ir_http.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/website_require_login/models/ir_http.py b/website_require_login/models/ir_http.py index 455f15851f..b0b0964770 100644 --- a/website_require_login/models/ir_http.py +++ b/website_require_login/models/ir_http.py @@ -33,6 +33,8 @@ def _require_login_whitelist_paths(cls): # are needed to correctly render the login page "/web", "/website/translations", + "/jsonrpc", + "/xmlrpc", ] @classmethod diff --git a/website_require_login/tests/test_ir_http.py b/website_require_login/tests/test_ir_http.py index 61a6cbbbe8..9de37182ca 100644 --- a/website_require_login/tests/test_ir_http.py +++ b/website_require_login/tests/test_ir_http.py @@ -60,6 +60,9 @@ def test_authorize_everything(self): "/contactus": "/web/login?redirect=/contactus", asset_attachment.url: asset_attachment.url, "/web/login": "/web/login", + "/jsonrpc": "/jsonrpc", + "/xmlrpc/2/common": "/xmlrpc/2/common", + "/xmlrpc/2/object": "/xmlrpc/2/object", } # Assert