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.5.0 to 0.6.0

2

package.json

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

},
"version": "0.5.0"
"version": "0.6.0"
}

@@ -198,3 +198,15 @@ # vue-jwt-auth

`**loginAs(data, redirectUrl, options)**`
Login as another user.
`**logoutAs(redirectUrl)**`
Logout or other user. Will revert to previously logged in user.
`**other()**`
Check if we are currently logged in as another user.
## Options

@@ -201,0 +213,0 @@

@@ -119,3 +119,3 @@ module.exports = (function () {

function _login(path, data, rememberMe, options) {
function _login(path, data, rememberMe, redirectUrl, options) {
options = options || {};

@@ -132,10 +132,10 @@

if (options.success) {
options.success.call(this, resp);
}
this.fetch(function () {
if (_this.getOption('loginRedirect') && _this.check()) {
_this.$router.go(_this.getOption('loginRedirect'));
if (options.success) {
options.success.call(_this, resp);
}
if (redirectUrl && _this.check()) {
_this.$router.go(redirectUrl);
}
});

@@ -151,3 +151,3 @@ }, {

function _social(type, data, rememberMe, options) {
function _social(type, data, rememberMe, redirectUrl, options) {
var state,

@@ -166,3 +166,3 @@ params = '';

data.state.rememberMe = rememberMe === true ? true : false;
data.state.redirect = this.getOption('loginRedirect') || '';
data.state.redirect = redirectUrl || '';

@@ -217,4 +217,2 @@ data.appId = data.appId || this.getOption(type + 'AppId');

authRedirect : '/login',
loginRedirect : '/account',
logoutRedirect : '/',

@@ -302,15 +300,15 @@ notFoundRedirect : '/404',

login: function (data, rememberMe, options) {
_login.call(this, this.getOption('loginUrl'), data, rememberMe, options);
login: function (data, rememberMe, redirectUrl, options) {
_login.call(this, this.getOption('loginUrl'), data, rememberMe, redirectUrl, options);
},
facebook: function (data, rememberMe, options) {
_social.call(this, 'facebook', data, rememberMe, options);
facebook: function (data, rememberMe, redirectUrl, options) {
_social.call(this, 'facebook', data, rememberMe, redirectUrl, options);
},
google: function (data, rememberMe, options) {
_social.call(this, 'google', data, rememberMe, options);
google: function (data, rememberMe, redirectUrl, options) {
_social.call(this, 'google', data, rememberMe, redirectUrl, options);
},
logout: function() {
logout: function(redirectUrl, force) {
_removeRememberMeCookie.call(this);

@@ -325,4 +323,4 @@

if (this.$route.auth && this.getOption('logoutRedirect')) {
this.$router.go(this.getOption('logoutRedirect'));
if (redirectUrl && (this.$route.auth || force)) {
this.$router.go(redirectUrl);
}

@@ -382,3 +380,3 @@ },

loginAs: function(data, options) {
loginAs: function(data, redirectUrl, options) {
options = options || {};

@@ -391,10 +389,10 @@

if (options.success) {
options.success.call(this, resp);
}
_fetch.call(this, function () {
if (_this.getOption('loginRedirect') && _this.check()) {
_this.$router.go(_this.getOption('loginRedirect'));
if (options.success) {
options.success.call(this, resp);
}
if (redirectUrl && _this.check()) {
_this.$router.go(redirectUrl);
}
});

@@ -410,3 +408,3 @@ }, {

logoutAs: function(options) {
logoutAs: function(redirectUrl) {
var _this = this;

@@ -417,4 +415,4 @@

_fetch.call(this, function () {
if (_this.$route.auth && _this.getOption('logoutRedirect')) {
_this.$router.go(_this.getOption('logoutRedirect'));
if (redirectUrl) {
_this.$router.go(redirectUrl);
}

@@ -425,2 +423,4 @@ });

other: function() {
this.data; // TODO: Strange thing, need this to make the check fire consistently ??
return localStorage.getItem('login-as-' + this.getOption('tokenName'));

@@ -431,3 +431,3 @@ }

return function install(Vue, options) {
return function install(Vue, options, router) {
var auth = new Vue(Auth);

@@ -448,3 +448,3 @@

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

@@ -451,0 +451,0 @@ // Make sure to use $auth.fetch so context is loaded.

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