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

  1. from odoo.addons.galicea_git.controllers.main import Main
  2. class ExtMain(Main):
  3. def authorize(self, req):
  4. auth = req.httprequest.authorization
  5. if auth and auth.password == 'bearer':
  6. access_token = req.httprequest.authorization.username
  7. token = req.env['galicea_openid_connect.access_token'].sudo().search(
  8. [('token', '=', access_token)]
  9. )
  10. if token:
  11. req.uid = token.user_id.id
  12. return
  13. super(ExtMain, self).authorize(req)