How to manually generate the Password to insert in the user table
Created 1 year 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  —  1 year ago

Just use bcrypt('password here')

ryanthompson  —  1 year ago

Use the UserRepository or the UserModel and you won't have to hash yourself:

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

Same with manually updating the value:

$user->password = "Top Secret";
squatto  —  1 year ago

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

ryanthompson  —  1 year 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 year ago

@ryanthompson Yes you do! More of these