Socket
Socket
Sign inDemoInstall

@ahi40/common

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ahi40/common - npm Package Compare versions

Comparing version 1.0.17 to 1.0.18

2

build/errors/not-authorized-error.js

@@ -22,3 +22,3 @@ "use strict";

var _this = _super.call(this, 'Not Authorized.') || this;
_this.statusCode = 401;
_this.statusCode = 403;
Object.setPrototypeOf(_this, NotAuthorizedError.prototype);

@@ -25,0 +25,0 @@ return _this;

@@ -22,3 +22,3 @@ "use strict";

var _this = _super.call(this, 'Token expired.') || this;
_this.statusCode = 401;
_this.statusCode = 402;
Object.setPrototypeOf(_this, TokenExpiredError.prototype);

@@ -25,0 +25,0 @@ return _this;

@@ -7,6 +7,9 @@ "use strict";

exports.requireAuth = function (req, res, next) {
console.log('run req auth');
if (!req.currentUser) {
console.log('no user set');
throw new not_authorized_error_1.NotAuthorizedError();
}
if (req.currentUser.exp < Date.now().valueOf() / 1000) {
console.log('token expired');
throw new token_expired_error_1.TokenExpiredError();

@@ -13,0 +16,0 @@ }

{
"name": "@ahi40/common",
"version": "1.0.17",
"version": "1.0.18",
"description": "",

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

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