hapi-auth-bearer-simple
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "hapi-auth-bearer-simple", | ||
"description": "Custom authentication plugin for Hapi using Bearer tokens", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": "Adri Van Houdt <adri@salesflare.com>", | ||
@@ -6,0 +6,0 @@ "private": false, |
@@ -16,11 +16,7 @@ # Hapi authentication plugin | ||
var server = Hapi.createServer('localhost', 8000, { | ||
cors: true | ||
}); | ||
var server = new Hapi.Server(localhost', 8000); | ||
server.pack.register({ | ||
plugin: require('hapi-auth-bearer-simple'), | ||
options: options | ||
}, function (err) { | ||
server.pack.register(require('hapi-auth-bearer-simple'), function (err) { | ||
server.auth.strategy('basic', 'bearerAuth', { | ||
@@ -64,2 +60,2 @@ validateFunction: validateFunction | ||
- `isValid` - `true` if both the username was found and the password matched, otherwise `false`. | ||
- `credentials` - an object passed back to the plugin and which will become available in the `request`object as `request.auth.credentials`. Normally credentials are only included when `isValid`is `true`. This object can be only the token as in the example but can also be the user ascassociated with the token | ||
- `credentials` - an object passed back to the plugin and which will become available in the `request`object as `request.auth.credentials`. Normally credentials are only included when `isValid`is `true`. This object can be only the token as in the example but is preferably all the info you need from the authenticated user |
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
8219
59