767595d9 by Johannes Zellner

store stringified objects in redis for now

1 parent c14b91b1
......@@ -39,8 +39,14 @@ if (process.env.REDIS_URL) {
}
// overwrite the tokenStore api
tokenStore.get = redisClient.get.bind(redisClient);
tokenStore.set = redisClient.set.bind(redisClient);
tokenStore.get = function (token, callback) {
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);
} else {
console.log('Use in-memory token store');
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!