Welcome Guest, Not a member yet? Register   Sign In
Mythauth - update password form
#11

(This post was last modified: 06-21-2021, 07:11 AM by kilishan.)

Alternatively, you could do something a little simpler like:

Code:
$userModel = model('UserModel');
$user = user();
$user->password = $this->request->getPost('password');
$userModel->save($user);

This grabs the currently logged in user via the user() helper function and returns a User entity. The setPassword() method is called automatically by the Entity class when you assign the password to the user entity, so simply assigning it like that will automatically hash the password. Then the User entity is saved.
Reply
#12

new release myth-auth, its easier to set password now.
can call direct: Password::hash($password);
Reply




Theme © iAndrew 2016 - Forum software by © MyBB