How to set user password in frontend (not panel)?

Hi,

we are trying to set the password of an user through the frontend (not within the panel). To achieve this we use the following function:

$site->user()->update(array('password' => password::hash($theNewPassword)))

This saves a corresponding hash to the database, but it is not possible to login with the user any more.

How can this be solved?

Best regards,

helllicht

The update() function hashes the password - so you are hashing it twice at the moment…

See: kirby/core/user.php:

if(!empty($data['password'])) {
  $data['password'] = password::hash($data['password']);
}
1 Like