1.0.0-alpha.1 • Published 8 years ago

vue-auth v1.0.0-alpha.1

Weekly downloads
29
License
MIT
Repository
github
Last release
8 years ago

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

1.0.0-alpha.1

8 years ago

2.0.0-alpha.1

8 years ago

0.4.1

8 years ago

4.0.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago