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.

19 lines
582 B

  1. # Copyright 2018 Therp BV <https://therp.nl>
  2. # Copyright 2019-2020 initOS GmbH <https://initos.com>
  3. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
  4. from odoo.http import request
  5. try:
  6. from radicale.auth import BaseAuth
  7. except ImportError:
  8. BaseAuth = None
  9. class Auth(BaseAuth):
  10. def login(self, user, password):
  11. env = request.env
  12. uid = env['res.users']._login(env.cr.dbname, user, password, {})
  13. login = request.env['res.users'].browse(uid).login
  14. if uid:
  15. request._env = env(user=uid)
  16. return login