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

sane-auth

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sane-auth - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

generate/templates/server/config/jwt.js

2

generate/client.js

@@ -30,3 +30,3 @@ module.exports = {

addEmberAddons: [{}],
addToConfig: [{}],
addToConfig: {},
addBowerPackages: [{}],

@@ -33,0 +33,0 @@ generates: [{

var jwt = require('jsonwebtoken');
var _ = require('lodash');
//change the scretes here as well as in policies/hasToken.js
var secret = '**n0t-S0-s3cr3t-K3y!';
var refreshSecret = 'r3Fr3sh-K3y*!';
var bcrypt = require('bcrypt');
/**

@@ -71,4 +69,4 @@ * AuthController

bearerToken = jwt.verify(token, secret);
refreshToken = jwt.verify(req.body.refresh_token, refreshSecret);
bearerToken = jwt.verify(token, sails.config.jwt.secret);
refreshToken = jwt.verify(req.body.refresh_token, sails.config.jwt.refresh_secret);

@@ -95,9 +93,9 @@ if (_.isEqual(bearerToken, refreshToken)) {

function issueTokens(user, res) {
var expirationTimeInMinutes = 60 * 2;
var expirationTimeInMinutes = sails.config.jwt.expiration_time_in_minutes;
var token = jwt.sign(user, secret, {
var token = jwt.sign(user, sails.config.jwt.secret, {
expiresInMinutes: expirationTimeInMinutes
});
var refreshToken = jwt.sign(user, refreshSecret, {
var refreshToken = jwt.sign(user, sails.config.jwt.refresh_secret, {
expiresInMinutes: expirationTimeInMinutes

@@ -104,0 +102,0 @@ });

@@ -1,5 +0,1 @@

var expressJwt = require('express-jwt');
//Create a new secret key here
var secret = '**n0t-S0-s3cr3t-K3y!';
module.exports = expressJwt({secret: secret});
module.exports = require('express-jwt')({secret: sails.config.jwt.secret});
{
"name": "sane-auth",
"version": "0.2.2",
"version": "0.2.3",
"description": "A Sane Stack Addon giving you basic OAauth2-JWT authentication for the full stack",

@@ -5,0 +5,0 @@ "scripts": {

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