From 015a2ff44f8286c36dc2c2b6dd236ddfa40ebeba Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Fri, 4 Nov 2022 10:35:16 +0700 Subject: Set none when auth not in headers --- indoteknik_api/controllers/controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_api/controllers/controller.py') diff --git a/indoteknik_api/controllers/controller.py b/indoteknik_api/controllers/controller.py index cb5e2363..9d0ff64e 100644 --- a/indoteknik_api/controllers/controller.py +++ b/indoteknik_api/controllers/controller.py @@ -22,7 +22,7 @@ class Controller(http.Controller): request.session.authenticate(db, username, password) return True except: - authorization = wsgienv['HTTP_AUTHORIZATION'] + authorization = wsgienv['HTTP_AUTHORIZATION'] or None token = request.env['ir.config_parameter'].sudo().get_param('rest_api_token') or '' if authorization == token: request.session.authenticate(config.get('db_name'), 'it@fixcomart.co.id', 'Fixcomart378') -- cgit v1.2.3