prevent error in case of invalid admin user setup

This commit is contained in:
Michael Schramm 2020-06-08 14:54:10 +02:00
parent 14d6493cec
commit 57e13b84df
2 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
### Changed
### Fixed
- startup error with invalid create admin config
### Security
## [0.9.2]

View File

@ -48,7 +48,11 @@ export class BootService implements OnApplicationBootstrap {
})
user.set('roles', ['user', 'admin', 'superuser'])
await user.save()
try {
await user.save()
} catch (e) {
this.logger.error('could not create admin user')
}
this.logger.info('new root user created')
}