From 15674e1921f74751fe5a467003839b130b93527f Mon Sep 17 00:00:00 2001 From: Jonathan Poissant Date: Thu, 13 Feb 2020 13:18:19 -0500 Subject: [PATCH] Bugfix: Allow both Read and Write if both are present in the scope --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 649c51c..599b204 100644 --- a/index.js +++ b/index.js @@ -60,7 +60,7 @@ exports.handler = function(event, context) { if (claims.scp.includes('api:read')) { policy.allowMethod(AuthPolicy.HttpVerb.GET, "*"); } - else if (claims.scp.includes('api:write')) { + if (claims.scp.includes('api:write')) { policy.allowMethod(AuthPolicy.HttpVerb.POST, "*"); policy.allowMethod(AuthPolicy.HttpVerb.PUT, "*"); policy.allowMethod(AuthPolicy.HttpVerb.PATCH, "*");