Fix getting API key from DB by returning its .value

This commit is contained in:
Pablo Carranza Vélez 2015-10-08 13:48:32 +00:00
parent 3d82ea8249
commit 3d7f5f3ced
2 changed files with 3 additions and 1 deletions

View File

@ -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]

View File

@ -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) ->