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

vue-jwt-auth

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-jwt-auth - npm Package Compare versions

Comparing version 0.6.1 to 0.7.0

Drivers/Buffer.js

2

package.json

@@ -19,3 +19,3 @@ {

},
"version": "0.6.1"
"version": "0.7.0"
}
module.exports = (function () {
var _tokenRefreshTimeout = null;
// Default

@@ -105,4 +107,12 @@

function _refreshToken() {
var _this = this;
if (_getToken.call(this)) {
this.$http.get(this.getOption('tokenUrl'));
clearTimeout(_tokenRefreshTimeout);
_tokenRefreshTimeout = setTimeout(function () {
_refreshToken.call(_this);
}, this.getOption('tokenTimeout'));
}

@@ -221,3 +231,4 @@ }

tokenName : 'jwt-auth-token',
tokenTimeout : 3000 * 1000, // 50 minutes (in milliseconds).
cookieDomain : _cookieDomain,

@@ -246,37 +257,2 @@ userData : _userData,

created: function () {
var _this = this;
this.$http.interceptors.push({
// Send auth token on each request.
request: function (req) {
var token = _getToken.call(_this);
if (token) {
if (_this.getOption('authType') === 'bearer') {
req.headers.Authorization = 'Bearer: ' + token;
}
}
return req;
},
// Reset auth token if provided in response.
response: function (res) {
var authorization = res.headers('authorization');
if (authorization) {
authorization = authorization.split(' ');
if (authorization[1]) {
_setToken.call(this, authorization[1]);
}
}
return res;
}
});
},
methods: {

@@ -437,3 +413,3 @@

// // Setup before each route change check.
// Setup before each route change check.
(Vue.router || router).beforeEach(function (transition) {

@@ -445,4 +421,36 @@

});
});
});
// Set interceptors.
Vue.http.interceptors.push({
// Send auth token on each request.
request: function (req) {
var token = _getToken.call(auth);
if (token) {
if (auth.getOption('authType') === 'bearer') {
req.headers.Authorization = 'Bearer: ' + token;
}
}
return req;
},
// Reset auth token if provided in response.
response: function (res) {
var authorization = res.headers('authorization');
if (authorization) {
authorization = authorization.split(' ');
if (authorization[1]) {
_setToken.call(auth, authorization[1]);
}
}
return res;
}
});
}
})();
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