- db.OAuthClient.loadFirstClient()
- .then(client => {
- if (!client) throw new Error('No client available.')
-
- const json: OAuthClientLocal = {
- client_id: client.clientId,
- client_secret: client.clientSecret
- }
- res.json(json)
- })
- .catch(err => next(err))
+ const client = await OAuthClientModel.loadFirstClient()
+ if (!client) throw new Error('No client available.')
+
+ const json: OAuthClientLocal = {
+ client_id: client.clientId,
+ client_secret: client.clientSecret
+ }
+ return res.json(json)