You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

14 lines
543 B

from odoo.addons.galicea_git.controllers.main import Main
class ExtMain(Main):
def authorize(self, req):
auth = req.httprequest.authorization
if auth and auth.password == 'bearer':
access_token = req.httprequest.authorization.username
token = req.env['galicea_openid_connect.access_token'].sudo().search(
[('token', '=', access_token)]
)
if token:
req.uid = token.user_id.id
return
super(ExtMain, self).authorize(req)