Reputation: 331
Given I'm developing an API with authentication under SailsJS where do you think I must/should insert the code to create or initialize the admin user if not exists?
Thanks!!
Upvotes: 0
Views: 313
Reputation: 191
If u need admin user for development, u can use bootstrap for that.
await User.create({ emailAddress: '[email protected]', fullName: 'Ryan Dahl', isSuperAdmin: true, password: await sails.helpers.passwords.hashPassword('abc123') }).fetch()
This is what Mike McNeil recommend in example.
Upvotes: 2