auth.js
async function retrieveUserFromRedis(res, auth, tokenOrEmail, config) {
  if (config.redisClient) {
    const getFromRedis = util
      .promisify(config.redisClient.get)
      .bind(config.redisClient);
    const cachedUserData = await getFromRedis(`${ns}:${tokenOrEmail}`);
    if (cachedUserData) {
      const data = JSON.parse(cachedUserData);
      const user = auth.createAuthFromData(data);
      auth.currentUser = user;
      res.locals = res.locals || {};
      res.locals.auth = auth;
      return user;
    }
  }
}
async function retrieveUserFromRedis(res, auth, tokenOrEmail, config) {
  if (config.redisClient) {
    const getFromRedis = util
      .promisify(config.redisClient.get)
      .bind(config.redisClient);
    const cachedUserData = await getFromRedis(`${ns}:${tokenOrEmail}`);
    if (cachedUserData) {
      const data = JSON.parse(cachedUserData);
      const user = auth.createAuthFromData(data);
      auth.currentUser = user;
      res.locals = res.locals || {};
      res.locals.auth = auth;
      return user;
    }
  }
}
async function retrieveUserFromRedis ( res , auth , tokenOrEmail , config ) { if ( config . redisClient ) { const getFromRedis = util . promisify ( config . redisClient . get ) . bind ( config . redisClient ) ; const cachedUserData = await getFromRedis ( ` ${ ns } ${ tokenOrEmail } ` ) ; if ( cachedUserData ) { const data = JSON . parse ( cachedUserData ) ; const user = auth . createAuthFromData ( data ) ; auth . currentUser = user ; res . locals = res . locals || { } ; res . locals . auth = auth ; return user ; } } }
Get User from Redis Client
@param  {!Response} res
@param  {!Auth} auth
@param  {!string} tokenOrEmail
@param  {!Object} config
@return {Auth}
Get User from Redis Client