Comparing version 17.0.0 to 17.0.1
@@ -110,4 +110,3 @@ 'use strict'; | ||
try { | ||
auth._access(request, route); | ||
return true; | ||
return auth._access(request, route); | ||
} | ||
@@ -259,5 +258,3 @@ catch (err) { | ||
const err = Boom.unauthorized('Missing authentication', errors); | ||
if (config.mode !== 'optional' && | ||
config.mode !== 'try') { | ||
if (config.mode === 'required') { | ||
throw err; | ||
@@ -275,10 +272,3 @@ } | ||
const auth = request._core.auth; | ||
try { | ||
auth._access(request); | ||
request.auth.isAuthorized = true; | ||
} | ||
catch (err) { | ||
request.auth.isAuthorized = false; | ||
throw err; | ||
} | ||
request.auth.isAuthorized = auth._access(request); | ||
} | ||
@@ -292,3 +282,3 @@ | ||
return; | ||
return true; | ||
} | ||
@@ -298,2 +288,6 @@ | ||
if (!credentials) { | ||
if (config.mode !== 'required') { | ||
return false; | ||
} | ||
throw Boom.forbidden('Request is unauthenticated'); | ||
@@ -337,3 +331,3 @@ } | ||
return; | ||
return true; | ||
} | ||
@@ -340,0 +334,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"homepage": "http://hapijs.com", | ||
"version": "17.0.0", | ||
"version": "17.0.1", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -0,0 +0,0 @@ <img src="https://raw.github.com/hapijs/hapi/master/images/17.png" align="right"/> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
164406
4047