Add default user to allow for default groups and IAM
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
2021-03-15 17:45:18 -05:00
parent 0844da594e
commit 3a91417db3
3 changed files with 33 additions and 0 deletions

View File

@@ -91,6 +91,7 @@ class AuthController extends Controller {
if ( !(await User.findOne()) ) user.promote('root')
await user.save()
await user.grant_defaults()
// Log in the user automatically
await this.auth.get_provider().session(req, user)
@@ -321,6 +322,7 @@ class AuthController extends Controller {
await user.reset_password(req.body.password, 'create')
await user.save()
await user.grant_defaults()
return res.api(await user.to_api())
}