# vue-auth

> Vue plugin for easily managing auth state

Latest version **1.0.0-alpha.1** (published 2016-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-auth
pnpm add vue-auth
yarn add vue-auth
bun add vue-auth
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.1 |
| Published | 2016-10-04 |
| First published | 2016-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Wade Urry |
| Maintainers | wader |
| Keywords | vue, auth, authentication, jwt, oauth, token |

## Links

- npm: https://www.npmjs.com/package/vue-auth
- Repository: https://github.com/iWader/vue-auth
- Homepage: https://github.com/iWader/vue-auth#readme
- Issues: https://github.com/iWader/vue-auth/issues
- npm.io page: https://npm.io/package/vue-auth

## Dependencies (1)

- [Base64](https://npm.io/package/Base64.md) ^1.0.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.0.0-alpha.1 (latest) — 2016-10-04
- 2.0.0-alpha.1 (next) — 2016-10-04
- 0.4.1 — 2016-09-21
- 4.0.1 — 2016-09-19
- 0.4.0 — 2016-09-05
- 0.3.0 — 2016-08-31
- 0.2.0 — 2016-08-29
- 0.1.0 — 2016-08-26

## README

# vue-auth

[![CircleCI](https://img.shields.io/circleci/project/iWader/vue-auth/master.svg)](https://circleci.com/gh/iWader/vue-auth) [![NPM](https://img.shields.io/npm/v/vue-auth.svg)](https://www.npmjs.com/package/vue-auth)

Vue plugin for easily managing your app's auth state

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

```javascript
npm require vue-auth --save
```

```javascript
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.

```javascript
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](LICENCE.md)

---
_Source: https://npm.io/package/vue-auth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
