New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

flora-auth-jwt

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flora-auth-jwt - npm Package Compare versions

Comparing version 2.0.0-alpha.1 to 2.0.0-alpha.2

14

index.js

@@ -6,8 +6,12 @@ 'use strict';

exports.name = 'auth-jwt';
/**
* @param {flora.Api} api - Api instance
* @param {object} options - Plugin options
* @param {string} options.secret - JWT secret
* @param {boolean} [options.credentialsRequired] - Fail on requests without JWT (default: false)
*/
module.exports = (api, options) => {
if (typeof options !== 'object') throw new Error('options must be an object');
if (!options.secret) throw new Error('options must contain a "secret" property');
exports.register = function register(api, options) {
if (typeof options !== 'object') throw new Error('opts must be an object');
if (!options.secret) throw new Error('opts must contain a "secret" property');
options.credentialsRequired = !!options.credentialsRequired;

@@ -14,0 +18,0 @@

{
"name": "flora-auth-jwt",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.2",
"description": "JSON Web Token authentication for Flora",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,7 +13,7 @@ # flora-auth-jwt

const flora = require('flora');
const floraAuth = require('flora-auth-jwt');
const floraAuthJwt = require('flora-auth-jwt');
const server = new flora.Server('./config.js');
server.register({
server.register('auth-jwt', floraAuthJwt, {
secret: 'My Secret Key',

@@ -20,0 +20,0 @@ credentialsRequired: false, // default: true

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