Skip to content
Snippets Groups Projects
Commit 6639630d authored by Denis Roussel's avatar Denis Roussel
Browse files

[FIX] base: make check_credentials more consistent with alternatives

The other methods do test password length before verifying it, so even
if check_credentials() is not meant to be called directly, it's better
to keep it consistent with the alternatives.

Closes #29023
parent 3b85900f
Branches
Tags
No related merge requests found
......@@ -444,6 +444,8 @@ class Users(models.Model):
@api.model
def check_credentials(self, password):
""" Override this method to plug additional authentication methods"""
if not password:
raise AccessDenied()
user = self.sudo().search([('id', '=', self._uid), ('password', '=', password)])
if not user:
raise AccessDenied()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment