Commit 767595d9 by Johannes Zellner

store stringified objects in redis for now

1 parent c14b91b1
Showing with 8 additions and 2 deletions
...@@ -39,8 +39,14 @@ if (process.env.REDIS_URL) { ...@@ -39,8 +39,14 @@ if (process.env.REDIS_URL) {
} }
// overwrite the tokenStore api // overwrite the tokenStore api
tokenStore.get = redisClient.get.bind(redisClient); tokenStore.get = function (token, callback) {
tokenStore.set = redisClient.set.bind(redisClient); redisClient.get(token, function (error, result) {
callback(error || null, safe.JSON.parse(result));
});
};
tokenStore.set = function (token, data, callback) {
redisClient.set(token, JSON.stringify(data), callback);
};
tokenStore.del = redisClient.del.bind(redisClient); tokenStore.del = redisClient.del.bind(redisClient);
} else { } else {
console.log('Use in-memory token store'); console.log('Use in-memory token store');
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!