We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not sure where the best place to do this is, but we should make the first user created/signed up get admin privilege
probably in the users find or create functionality, do a count or something, if it's 0 then give user admin group.
user's are signed up here https://github.com/ladjs/lad/blob/master/template/app/controllers/web/auth.js#L93-L96 so probably right before that code block something like:
// register the user try { const count = await Users.count({ group: 'admin' }); const user = await Users.registerAsync( { email: ctx.req.body.email, group: count === 0 ? 'admin' : ' user' }, ctx.req.body.password );
The text was updated successfully, but these errors were encountered:
related to #277
Sorry, something went wrong.
That worked, I'll push the fix right now
8cb7cae
Add first user to admin group (fix #278)
69906a5
pablopunk
No branches or pull requests
not sure where the best place to do this is, but we should make the first user created/signed up get admin privilege
probably in the users find or create functionality, do a count or something, if it's 0 then give user admin group.
user's are signed up here https://github.com/ladjs/lad/blob/master/template/app/controllers/web/auth.js#L93-L96 so probably right before that code block something like:
The text was updated successfully, but these errors were encountered: