Fix password reset

Fixes #6049