How to manually generate the Password to insert in the user table

srinivas214 - 1 month ago

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 - 1 month ago

Just use bcrypt('password here')

ryanthompson - 1 month 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 - 1 month ago

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

ryanthompson - 1 month 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 - 1 month ago

@ryanthompson Yes you do! More of these