vue-auth

Vue plugin for easily managing auth state
1,200 15
Install
npm install vue-auth@4.0.1
Latest Version:4.0.1
Vue:1
License:MIT
Last Updated:Oct 10, 2016
Links: GitHub  ·  npm
Maintainer: wader

vue-auth

CircleCI NPM

Vue plugin for easily managing your app's auth state

This is a work in progress and the API may change without notice

Installation

npm require vue-auth --save
var Vue = require('vue')
var VueAuth = require('vue-auth')

Vue.use(VueAuth)

Usage

To access the auth object you'll find the $auth property on your application instance. (e.g this.$auth.getToken())

Options
  • storagePrefix - Prefix to the storage keys used in localStorage
  • authPath - URI the user should be redirected to to re-authenticate
  • redirectType - May be either router or browser. Which method should the user be redirected with?

Setting options is done the same as all Vue plugins.

Vue.use(VueAuth, {
  storagePrefix: '_prefix.',
  redirectType: 'browser'
})
Methods
  • getToken()
  • setToken(token)
  • removeToken()
  • hasToken()
  • isAuthenticated()
  • getUserData()
  • setUserData(data)

Licence

Copyright (c) 2016 Wade Urry - Released under the MIT Licence

Related Packages

vue-easy-jwt

Library for decoding a jwt token

5,094 4
vue-authenticate

Authentication library for Vue.js

66,104 1,421
vue-authenticate-2

Authentication library for Vue.js

4,798 10
vue-auth0-handler

Vue2 Component to handle login/logout and authentication callbacks from Auth0's...

1,113 1
vue-auth-jwt

*An open-source Vue.js authentication package for JWT*

400

Version History

Version Released Vue License
4.0.1 ^1.0.26 MIT
0.4.1 ^1.0.26 MIT
0.4.0 ^1.0.26 MIT
0.3.0 MIT
0.2.0 MIT
Pre-releases (2)
Version Released Vue License
2.0.0-alpha.1 ^2.0.1 MIT
1.0.0-alpha.1 ^1.0.26 MIT