Skip to content

Commit

Permalink
Updating auth() signature
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed May 29, 2017
1 parent d1d7ed0 commit 488eb24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,8 @@ function auth (obj, config) {
obj.server.use(middleware.parse, all).blacklist(middleware.parse);
obj.server.blacklist(middleware.asyncFlag);

config.auth.protect = (config.auth.protect || []).map(i => {
return new RegExp("^" + i !== "/login" ? i.replace(/\.\*/g, "*").replace(/\*/g, ".*") : "$", "i");
});

config.auth.unprotect = (config.auth.unprotect || []).map(i => {
return new RegExp("^" + i !== "/login" ? i.replace(/\.\*/g, "*").replace(/\*/g, ".*") : "$", "i");
retsu.each(["protect", "unprotect"], k => {
config.auth[k] = (config.auth[k] || []).map(i => new RegExp("^" + i !== "/login" ? i.replace(/\.\*/g, "*").replace(/\*/g, ".*") : "$", "i"));
});

if (async) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an elastic REST API gateway for node.js",
"version": "4.5.20",
"version": "4.5.21",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

0 comments on commit 488eb24

Please sign in to comment.