From 950d962d95d214bdd1bdd64d8771af96d4d618cf Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 13 May 2019 12:31:37 +0000 Subject: [IMP] core: add env to various auth methods Allows accessing various keys, especially whether this is an interactive login or not. Also have the xml-rpc `login` delegate to `authenticate` instead of having its own half-assed implementation. And remove some dead code: as far as I can tell, Session.authenticate is never called with a uid. --- addons/auth_oauth/models/res_users.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/auth_oauth') diff --git a/addons/auth_oauth/models/res_users.py b/addons/auth_oauth/models/res_users.py index 0e54a23b0aa..2ee46b6b38c 100644 --- a/addons/auth_oauth/models/res_users.py +++ b/addons/auth_oauth/models/res_users.py @@ -109,9 +109,9 @@ class ResUsers(models.Model): # return user credentials return (self.env.cr.dbname, login, access_token) - def _check_credentials(self, password): + def _check_credentials(self, password, env): try: - return super(ResUsers, self)._check_credentials(password) + return super(ResUsers, self)._check_credentials(password, env) except AccessDenied: res = self.sudo().search([('id', '=', self.env.uid), ('oauth_access_token', '=', password)]) if not res: -- cgit v1.2.3