+
+
+
 httpProxy = require('http-proxy')
 passport = require('passport')
 MixedStrategy = require('./mixed_strategy')
+Cookies = require('cookies')
 
 HeaderText = "<body>header text </body>"
 

ensureAuthed = (req, res, next) ->
  if req.session.passport?.user?
    return next()
  return passport.authenticate(req.authproxy_domain, { scope: ['profile', 'email'], successRedirect: req.originalUrl, failureRedirect: '/authproxy/google' })(req, res, next)

  # return res.redirect('/authproxy/google')



  callback: () =>
    (req, res, next) =>
      passport.authenticate(req.authproxy_domain, { successRedirect: '/authproxy/land', failureRedirect: '/authproxy/google' })(req, res, next)

  checkDomain: =>
    (req, res, next) =>
