mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-02 20:16:47 +00:00
Fix getting API key from DB by returning its .value
This commit is contained in:
parent
3d82ea8249
commit
3d7f5f3ced
@ -1,3 +1,5 @@
|
|||||||
|
* Fix getting API key from DB by returning its .value [Pablo]
|
||||||
|
|
||||||
# v1.0.1
|
# v1.0.1
|
||||||
|
|
||||||
* Pass supervisor API key to app, don't regenerate the key, and authenticate ALL requests [Pablo]
|
* Pass supervisor API key to app, don't regenerate the key, and authenticate ALL requests [Pablo]
|
||||||
|
@ -106,7 +106,7 @@ exports.getOrGenerateApiSecret = do ->
|
|||||||
apiSecretPromise = apiSecretPromise.catch ->
|
apiSecretPromise = apiSecretPromise.catch ->
|
||||||
knex('config').select('value').where(key: 'apiSecret')
|
knex('config').select('value').where(key: 'apiSecret')
|
||||||
.then ([ apiSecret ]) ->
|
.then ([ apiSecret ]) ->
|
||||||
return apiSecret if apiSecret?
|
return apiSecret.value if apiSecret?
|
||||||
Promise.try ->
|
Promise.try ->
|
||||||
return config.forceApiSecret ? randomHexString.generate()
|
return config.forceApiSecret ? randomHexString.generate()
|
||||||
.then (newSecret) ->
|
.then (newSecret) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user