This fixes the "ref undefined" error in the following line:
(callback) => @db.apps.checkDomain oauthio.k, ref, callback
Merge pull request #62 from bettiolo/ref_undefined_bug

 "ref undefined" error while doing non CORS requests