             user = id: profile.id
             break
 
-    USERS[user.id] = user if user
+    if !use_redis_store
+      USERS[user.id] = user if user
 
     done null, user
 


{ensureLoggedIn}    = require 'connect-ensure-login'


# Configure google login
protocol = if process.env.USE_SSL is '1' then 'https' else 'http'



passport.deserializeUser (id, done) ->
  if use_redis_store
    done null, id
  else
    if not USERS[id]
      done new Error "Cannot find user", id
    else
      done null, USERS[id]


router.get '/', ensureLoggedIn('/index'), (req, res) ->
