Fixes a database error when trying to validate after a password change

Signed-off-by: emanuele <emanuele45@gmail.com>