mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-21 14:37:49 +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
|
||||
|
||||
* 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 ->
|
||||
knex('config').select('value').where(key: 'apiSecret')
|
||||
.then ([ apiSecret ]) ->
|
||||
return apiSecret if apiSecret?
|
||||
return apiSecret.value if apiSecret?
|
||||
Promise.try ->
|
||||
return config.forceApiSecret ? randomHexString.generate()
|
||||
.then (newSecret) ->
|
||||
|
Loading…
Reference in New Issue
Block a user