From c38a1e49946cb1d435fe28d534e31ebf6aa258e8 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 16 Feb 2018 23:53:42 +0330 Subject: [PATCH] feat: add auth0-js scheme --- examples/api/auth.js | 3 +- examples/demo/layouts/default.vue | 3 +- examples/demo/nuxt.config.js | 22 ++- examples/demo/pages/login.vue | 7 +- lib/auth/auth.js | 126 ++++++++------ lib/auth/plugin.js | 7 +- lib/auth/schemes/auth0.js | 93 ++++++++++ lib/auth/schemes/local.js | 9 +- lib/auth/utilities.js | 1 + lib/module.js | 7 +- package.json | 2 + yarn.lock | 272 +++++++++++++++++++++++++++++- 12 files changed, 473 insertions(+), 79 deletions(-) create mode 100644 lib/auth/schemes/auth0.js diff --git a/examples/api/auth.js b/examples/api/auth.js index 53f9e0778..28d580624 100644 --- a/examples/api/auth.js +++ b/examples/api/auth.js @@ -34,7 +34,8 @@ app.post('/login', (req, res, next) => { const accessToken = jsonwebtoken.sign( { username, - rand: Math.random() * 1000, + picture: 'https://github.com/nuxt.png', + name: 'User ' + username, scope: ['test', 'user'] }, 'dummy' diff --git a/examples/demo/layouts/default.vue b/examples/demo/layouts/default.vue index 42c6ab9d4..32e35406f 100644 --- a/examples/demo/layouts/default.vue +++ b/examples/demo/layouts/default.vue @@ -12,9 +12,10 @@