mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Add folio services
This commit is contained in:
committed by
Darío Lodeiros
parent
a706b7a308
commit
308c35f878
@@ -1,4 +1,6 @@
|
||||
from odoo.addons.base_rest.controllers import main
|
||||
from ..lib_jwt.jwt_http import jwt_http
|
||||
from ..lib_jwt.validator import validator
|
||||
|
||||
|
||||
class BaseRestDemoPublicApiController(main.RestController):
|
||||
@@ -7,13 +9,13 @@ class BaseRestDemoPublicApiController(main.RestController):
|
||||
_default_auth = "public"
|
||||
|
||||
# RestController OVERRIDE method
|
||||
# def _process_method(self, service_name, method_name, *args, params=None):
|
||||
#
|
||||
# http_method, body, headers, token = jwt_http.parse_request()
|
||||
# result = validator.verify_token(token)
|
||||
# if not result["status"]:
|
||||
# return jwt_http.errcode(code=result["code"], message=result["message"])
|
||||
# else:
|
||||
# return super(BaseRestDemoPublicApiController, self)._process_method(
|
||||
# service_name, method_name, *args, params=params
|
||||
# )
|
||||
def _process_method(self, service_name, method_name, *args, params=None):
|
||||
|
||||
http_method, body, headers, token = jwt_http.parse_request()
|
||||
result = validator.verify_token(token)
|
||||
if not result["status"]:
|
||||
return jwt_http.errcode(code=result["code"], message=result["message"])
|
||||
else:
|
||||
return super(BaseRestDemoPublicApiController, self)._process_method(
|
||||
service_name, method_name, *args, params=params
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user