Add app.isAuthEnabled.
The flag is set by `app.enableAuth` and can be used to detect whether the access control is enabled.
This commit is contained in:
parent
d2adda5f29
commit
38f4748021
|
@ -305,7 +305,9 @@ app.enableAuth = function() {
|
|||
next();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.isAuthEnabled = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize an application from an options object or a set of JSON and JavaScript files.
|
||||
|
|
|
@ -400,6 +400,14 @@ describe('app', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('enableAuth', function() {
|
||||
it('should set app.isAuthEnabled to true', function() {
|
||||
expect(app.isAuthEnabled).to.not.equal(true);
|
||||
app.enableAuth();
|
||||
expect(app.isAuthEnabled).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('app.get("/", loopback.status())', function () {
|
||||
it('should return the status of the application', function (done) {
|
||||
var app = loopback();
|
||||
|
|
Loading…
Reference in New Issue