How to manually generate the Password to insert in the user table
Created 6 years ago by srinivas214

Hi, If i manually insert the user record in the users_users table, I would need to encrypt the password and insert, Is there a way to generate the password manually using any of the Pyrocms functions. Please help me to get this. Thanks

squatto  —  6 years ago

Just use bcrypt('password here')

ryanthompson  —  6 years ago

Use the UserRepository or the UserModel and you won't have to hash yourself: https://github.com/anomalylabs/users-module/blob/2.4/src/User/UserModel.php#L238

UserModel::create($data); // For example

Same with manually updating the value:

$user->password = "Top Secret";
$user->save();
squatto  —  6 years ago

Ah, perfect. As usual, Ryan has thought of it all!

ryanthompson  —  6 years ago

@squatto I need to get the reactions-extension added to the forum so we can thumbs up and use emojis n stuff lol.

squatto  —  6 years ago

@ryanthompson Yes you do! More of these