# vue-auth0

> Vue plugin for auth0

Latest version **1.0.1** (published 2017-09-04) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-09-04 |
| First published | 2017-09-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| Author | Manuel Ochoa Loaiza |
| Maintainers | mgochoa |

## Links

- npm: https://www.npmjs.com/package/vue-auth0
- npm.io page: https://npm.io/package/vue-auth0

## Dependencies (1)

- [auth0-js](https://npm.io/package/auth0-js.md) ^8.9.3

## Recent versions

- 1.0.1 (latest) — 2017-09-04
- 1.0.0 — 2017-09-04

## README

# Vue Auth0

A auth0-js V8 plugin for Vue 2.X

## Why?

I've seen my self in the need of create my own logins with Auth0 without the plugin they offer.

## Usage

Install the plugin like any other plugin. :)

~~~js
var Vue = require('vue');

Vue.use(require('vue-auth0'), {
  clientId: 'XXXXXXXXXXX',
  domain: 'myhost.auth0.com',
  callbackUrl: 'http://myhost/callback',
  audience: 'https://myhost.auth0.com/userinfo',
  redirectUri: 'https://myhost/callback',
})

~~~

### Manually using the auth0 instance.

Inside your components, you just need to access the `$auth0` object.

~~~js
export default {
    ready () {
        this.$auth0.login(username,password).then(() => {
            console.log(this.$auth0.profile)
        },error => {
            console.log(error)
        })
    },
    logout(){
        this.$auth0.logout();
    }
}
~~~


### After first login

Following data is saved on Local Storage:

- **expires_at:** Tokens time-to-live
- **id_token:** JWT that Auth0 returns
- **access_token:** Token for doing request about information and rules to Auth0
- **profile:** Profile information saved in a JSON


### Also accessible on components

- **this.$auth0.webAuth:** WebAuth object provided by Auth0
- **this.$auth0.profile:** Profile information
- **this.$auth9.options:** Options of the Initialization

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