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

authbase

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

authbase - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

10

lib/router.js

@@ -7,2 +7,5 @@ var ExpressRouter = require('express').Router,

var Router = function(options) {
if (typeof options.onAuthenticated !== 'function') throw 'AuthBase Router requires onAuthenticated(req, res) callback';
if (typeof options.onError !== 'function') throw 'AuthBase Router requires onError(err, req, res, next) callback';
var router = ExpressRouter();

@@ -22,8 +25,9 @@

router.get('/authbase/return', function(req, res) {
router.get('/authbase/return', function(req, res, next) {
try {
req.user = jwt.decode(req.query.token, options.secret).sub;
options.onAuthenticated(req, res);
} catch(e) {
console.error('AuthBase error:', e);
} catch(err) {
console.error('AuthBase error:', err.stack || err);
options.onError(err, req, res, next);
}

@@ -30,0 +34,0 @@ });

{
"name": "authbase",
"version": "0.0.9",
"version": "0.0.10",
"description": "AuthBase API Client and Router",

@@ -5,0 +5,0 @@ "main": "./lib",

@@ -70,2 +70,3 @@ var expect = require('expect.js'),

expect(user).to.be(undefined);
expect(err).to.eql({error: 'this is an error'});
mock.done();

@@ -72,0 +73,0 @@ done();

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