[FIX] base: force comparison between strings
When using another login method than stored password (ldpa,i oauth...), user's password is NULL in database. Passlib < 1.7 expect the encrypted password to be a string, leading to an uncaught traceback, forbidding login.
This commit is contained in:
@@ -290,8 +290,9 @@ class Users(models.Model):
|
||||
@api.model
|
||||
def check_credentials(self, password):
|
||||
""" Override this method to plug additional authentication methods"""
|
||||
assert password
|
||||
self.env.cr.execute(
|
||||
'SELECT password FROM res_users WHERE id=%s',
|
||||
"SELECT COALESCE(password, '') FROM res_users WHERE id=%s",
|
||||
[self.env.user.id]
|
||||
)
|
||||
[hashed] = self.env.cr.fetchone()
|
||||
|
||||
Reference in New Issue
Block a user