Skip to content

Commit

Permalink
Remove auto-bind dependency. (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikv authored and niftylettuce committed Sep 9, 2019
1 parent d798482 commit 7dc7b2d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
}
],
"dependencies": {
"auto-bind": "^2.0.0",
"csrf": "^3.0.6"
},
"devDependencies": {
Expand Down
5 changes: 1 addition & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const csrf = require('csrf');
const autoBind = require('auto-bind');

class CSRF {
constructor(opts = {}) {
Expand All @@ -15,9 +14,7 @@ class CSRF {

this.tokens = csrf(opts);

autoBind(this);

return this.middleware;
return this.middleware.bind(this);
}

middleware(ctx, next) {
Expand Down
1 change: 1 addition & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ test.before.cb(t => {
ctx.body = ctx.csrf;
return;
}

ctx.body = 'OK';
});
request = supertest.agent(app.listen(t.end));
Expand Down

0 comments on commit 7dc7b2d

Please sign in to comment.