oaeproject/Hilary — pull request #774 by simong (2014-02-11 15:41:59+00:00)
Title: External authentication logAuthenticationSuccess bug: user is undefined sometimes

```
[2014-02-05T15:46:46.462Z] ERROR: oae-server/18923 on release0: Unhandled error in the request chain, caught at the default error handler. (req.remoteAddress=127.0.0.1, req.remotePort=51925)
GET /api/auth/google/callback?error=access_denied HTTP/1.1
x-real-ip: 131.111.184.112
x-forwarded-for: 131.111.184.112
host: oae.oae-release0.oaeproject.org
x-nginx-proxy: true
cache-control: max-age=0
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36
x-chrome-variations: CKy1yQEIlrbJAQiktskBCKm2yQEIwbbJAQihiMoBCLmIygEIjJPKAQiOk8oB
referer: https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=https%3A%2F%2Foae.oae-release0.oaeproject.org%2Fapi%2Fauth%2Fgoogle%2Fcallback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&client_id=832766182042-qh6jaoivvita7go298g7nevhcj6ghpci.apps.googleusercontent.com
accept-encoding: gzip,deflate,sdch
accept-language: en-US,en;q=0.8
cookie: __utma=161612450.1036103470.1391594005.1391594005.1391594005.1; __utmc=161612450; __utmz=161612450.1391594005.1.1.utmcsr=t.co|utmccn=(referral)|utmcmd=referral|utmcct=/zklCp2ndQ3; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%7D%7D.EhTEsaH%2FV59znqFRThD7cLN7CuegFzBa8s%2FIlqcT4Qs
--
TypeError: Object false has no method 'isTenantAdmin'
at module.exports.logAuthenticationSuccess (/opt/oae/node_modules/oae-authentication/lib/util.js:96:29)
at Object.module.exports.externalSuccessCallback (/opt/oae/node_modules/oae-authentication/lib/util.js:139:5)
at /opt/oae/node_modules/oae-authentication/lib/strategies/google/rest.js:53:28
at allFailed (/opt/oae/node_modules/passport/lib/middleware/authenticate.js:87:18)
at attempt (/opt/oae/node_modules/passport/lib/middleware/authenticate.js:160:28)
at Strategy.strategy.fail (/opt/oae/node_modules/passport/lib/middleware/authenticate.js:277:9)
at Strategy.OAuth2Strategy.authenticate (/opt/oae/node_modules/passport-google-oauth/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth2.js:101:17)
at attempt (/opt/oae/node_modules/passport/lib/middleware/authenticate.js:337:16)
at authenticate (/opt/oae/node_modules/passport/lib/middleware/authenticate.js:338:7)
at /opt/oae/node_modules/oae-authentication/lib/strategies/google/rest.js:54:7```