diff --git a/lib/application.js b/lib/application.js index f5df7871..61015f3b 100644 --- a/lib/application.js +++ b/lib/application.js @@ -327,8 +327,10 @@ app.enableAuth = function(options) { g.f('Authentication requires model %s to be defined.', m)); } - if (m.dataSource || m.app) return; + if (Model.dataSource || Model.app) return; + // Find descendants of Model that are attached, + // for example "Customer" extending "User" model for (var name in appModels) { var candidate = appModels[name]; var isSubclass = candidate.prototype instanceof Model;