Merge pull request #2697 from strongloop/fix/various
Fix app.enableAuth and test/user
This commit is contained in:
commit
f362084770
|
@ -328,8 +328,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;
|
||||
|
|
|
@ -66,7 +66,6 @@ describe('User', function() {
|
|||
app.enableAuth({ dataSource: 'db' });
|
||||
app.use(loopback.token({ model: AccessToken }));
|
||||
app.use(loopback.rest());
|
||||
app.model(User);
|
||||
|
||||
User.create(validCredentials, function(err, user) {
|
||||
if (err) return done(err);
|
||||
|
|
Loading…
Reference in New Issue