Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Commit

Permalink
Store config at app.config (#312)
Browse files Browse the repository at this point in the history
* Store config at `app.config`

* Use app.set to store config.

* Add test.
  • Loading branch information
marshallswain committed Oct 13, 2016
1 parent 45ccaa1 commit a5ad6d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/client/index.js
Expand Up @@ -21,6 +21,7 @@ export default function(opts = {}) {

return function() {
const app = this;
app.set('authentication', config);

if (!app.get('storage')) {
const storage = getStorage(config.storage);
Expand Down
9 changes: 9 additions & 0 deletions test/client/index.test.js
Expand Up @@ -36,6 +36,15 @@ const setupTests = initApp => {
app = initApp();
});

it('config available at app.get("authentication")', () => {
expect(app.get('authentication')).to.deep.equal({
cookie: 'feathers-jwt',
tokenKey: 'feathers-jwt',
localEndpoint: '/auth/local',
tokenEndpoint: '/auth/token'
});
});

it('local username password authentication', () => {
return app.authenticate(options).then(response => {
expect(response.token).to.not.equal(undefined);
Expand Down

0 comments on commit a5ad6d2

Please sign in to comment.