InCuca / vuepress-pass

VuePress authentication plugin
MIT License
13 stars 1 forks source link

Can you give a example of the use? #8

Open farnetani opened 5 years ago

farnetani commented 5 years ago

Can you give a example of the use?

klarkc commented 5 years ago

Hey, look here: https://github.com/InCuca/vuepress-pass/tree/master/__tests__/fixtures/empty-options

Just replace .vuepress/config.js content with this:

const Pass = require('vuepress-pass');

module.exports = {
  plugins: [
        [Pass, {
            url: 'https://foo.bar/oauth',
            redirectUri: 'https://foo.bar/callback',
            clientId: 'foobar',
            authenticated(redirectQuery) { }, // optional
            unauthenticated(authQuery, redirect) { redirect(authQuery); }, // optional
        }],
    ]
};