prevent error in case of invalid admin user setup
This commit is contained in:
parent
14d6493cec
commit
57e13b84df
@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
### Added
|
### Added
|
||||||
### Changed
|
### Changed
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- startup error with invalid create admin config
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
## [0.9.2]
|
## [0.9.2]
|
||||||
|
|||||||
@ -48,7 +48,11 @@ export class BootService implements OnApplicationBootstrap {
|
|||||||
})
|
})
|
||||||
|
|
||||||
user.set('roles', ['user', 'admin', 'superuser'])
|
user.set('roles', ['user', 'admin', 'superuser'])
|
||||||
|
try {
|
||||||
await user.save()
|
await user.save()
|
||||||
|
} catch (e) {
|
||||||
|
this.logger.error('could not create admin user')
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.info('new root user created')
|
this.logger.info('new root user created')
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user