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

@adonisjs/auth

Package Overview
Dependencies
Maintainers
2
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adonisjs/auth - npm Package Compare versions

Comparing version 3.0.7 to 3.1.0

9

CHANGELOG.md

@@ -0,1 +1,10 @@

# [3.1.0](https://github.com/adonisjs/adonis-auth/compare/v3.0.7...v3.1.0) (2019-11-05)
### Features
* add support for jwt public key ([d9f1ad9](https://github.com/adonisjs/adonis-auth/commit/d9f1ad9))
<a name="3.0.7"></a>

@@ -2,0 +11,0 @@ ## [3.0.7](https://github.com/adonisjs/adonis-auth/compare/v3.0.6...v3.0.7) (2018-10-01)

2

package.json
{
"name": "@adonisjs/auth",
"version": "3.0.7",
"version": "3.1.0",
"description": "Offical authentication provider for Adonis framework",

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

@@ -70,2 +70,13 @@ 'use strict'

/**
* The jwt public
*
* @attribute jwtPublic
* @type {String|Null}
* @readOnly
*/
get jwtPublic () {
return _.get(this.jwtOptions, 'public', null)
}
/**
* Signs payload with jwtSecret using {{#crossLink "JwtScheme/jwtOptions:attribute"}}{{/crossLink}}

@@ -83,3 +94,3 @@ *

_signToken (payload, options) {
options = _.size(options) && _.isPlainObject(options) ? options : _.omit(this.jwtOptions, 'secret')
options = _.size(options) && _.isPlainObject(options) ? options : _.omit(this.jwtOptions, ['secret', 'public'])
return signToken(payload, this.jwtSecret, options)

@@ -101,4 +112,5 @@ }

_verifyToken (token) {
const options = _.omit(this.jwtOptions, 'secret')
return verifyToken(token, this.jwtSecret, options)
const options = _.omit(this.jwtOptions, ['secret', 'public'])
const secretOrPublicKey = this.jwtPublic !== null ? this.jwtPublic : this.jwtSecret
return verifyToken(token, secretOrPublicKey, options)
}

@@ -105,0 +117,0 @@

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