vuepress-pass

1.1.1 • Public • Published

VuePress Pass

Travis

VuePress oauth2 plugin

Usage

npm i --save InCuca/vuepress-pass

.vuepress/config.js:

const Pass = require('vuepress-pass');
 
module.exports = {
  plugins: [
        [Pass, {
            url: 'https://foo.bar/oauth',
            redirectUri: 'https://foo.bar/callback',
            clientId: 'foobar',
            authenticated(redirectQuery, redirect) { redirect('/'); }, // optional
            unauthenticated(authQuery, redirect) { redirect(authQuery); }, // optional
            setState(state) { localStorage.setItem('auth', state); }, // optional
            getState() { return localStorage.getItem('auth'); }, // optional
        }],
    ]
};
  • authenticated is called when user comes back from provider authentication
  • unauthenticated is called when user need's authentication on provide and will redirect (through redirect function)

more details

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    2
  • 1.1.0
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i vuepress-pass

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

22.7 kB

Total Files

26

Last publish

Collaborators

  • victorotavio
  • incuca.tech