Closed chriswainformatik closed 10 months ago
Working with raw files directly was always fine in Grav. But there are also some api for managing users. I dunno, it may be what you need: https://learn.getgrav.org/17/api#class-gravcommonflextypesusersusercollection
Unfortunately, I was not able to create raw yaml files for user accounts. I don't know what class from the api to use in order to create a account file. Could someone point me in the right direction how this can be done?
It's not complicated: https://github.com/getgrav/grav-plugin-login#manual-user-creation
Ok you are right but the example is without a password. I didn't manage to create a valid password hash. How do I do that?
Simply put:
password: YourPasswordPlainText
Grav will automically replace this with a hashedPassword when you log in successfully the first time.
That was exactly the hint I needed! I managed to create multiple accounts from a csv file.
Is there a way to quickly create multiple user accounts? Like a csv upload? Or would it be safe to create the yaml files by a script and upload them to the user accounts directory?