Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-auth-bearer-simple

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-auth-bearer-simple - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

package.json
{
"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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc