Skip to content

upgrade to @nuxtjs/auth-next v5 + dependency updates #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
AUTH0_CLIENT_ID=""
AUTH0_DOMAIN=""
AUTH0_AUDIENCE=""
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ You can access a simple demo here: https://auth0.nuxtjs.org

## Setup

* Create an account at Auth0 (https://auth0.com)
* Add your endpoints to your client's allowed urls like this ![nuxt-callbacks](https://cloud.githubusercontent.com/assets/904724/22703633/23f35724-ed65-11e6-83e4-227ad77c00ff.png)
* Add your logout endpoint to your account allowed urls like this ![nuxt-logout-cb](https://cloud.githubusercontent.com/assets/904724/22703768/9782bbbc-ed65-11e6-93b7-9c1e4d5d7984.png)
- Create an account at Auth0 (https://auth0.com)
- Add your endpoints to your client's allowed urls like this ![nuxt-callbacks](https://cloud.githubusercontent.com/assets/904724/22703633/23f35724-ed65-11e6-83e4-227ad77c00ff.png)
- Add your logout endpoint to your account allowed urls like this ![nuxt-logout-cb](https://cloud.githubusercontent.com/assets/904724/22703768/9782bbbc-ed65-11e6-93b7-9c1e4d5d7984.png)

* Copy the file `.env.example` at the root folder, rename it as `.env` and add your Auth0 keys
- Copy the file `.env.example` at the root folder, rename it as `.env` and add your Auth0 keys
- Find the audience value at https://manage.auth0.com/#/apis

## Running Locally

Expand All @@ -22,4 +23,3 @@ cd example-auth0
npm install
npm run dev
```

49 changes: 25 additions & 24 deletions nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
import 'dotenv/config'
import "dotenv/config";

export default {
/*
** Headers of the page
*/
** Headers of the page
*/
head: {
title: 'Nuxt.js + Auth0',
title: "Nuxt.js + Auth0",
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Nuxt.js project' }
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ hid: "description", name: "description", content: "Nuxt.js project" }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: 'https://nuxtjs.org/favicon.ico' }
{
rel: "icon",
type: "image/x-icon",
href: "https://nuxtjs.org/favicon.ico"
}
]
},
/*
** Global CSS
*/
css: [
'normalize.css',
'@/assets/main.css'
],
** Global CSS
*/
css: ["normalize.css", "@/assets/main.css"],
/*
** Modules
*/
** Modules
*/
modules: [
// axios is required by @nuxtjs/auth
'@nuxtjs/axios',
"@nuxtjs/axios",
// https://auth.nuxtjs.org
'@nuxtjs/auth'
"@nuxtjs/auth-next"
],
auth: {
redirect: {
login: '/', // redirect user when not connected
callback: '/auth/signed-in'
login: "/", // redirect user when not connected
callback: "/auth/signed-in"
},
strategies: {
local: false,
auth0: {
domain: process.env.AUTH0_DOMAIN,
client_id: process.env.AUTH0_CLIENT_ID
clientId: process.env.AUTH0_CLIENT_ID,
audience: process.env.AUTH0_AUDIENCE
}
}
},
build: {
// For stormkit.io
publicPath: process.env.PUBLIC_PATH,
publicPath: process.env.PUBLIC_PATH
}
}
};
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"start": "nuxt-start"
},
"dependencies": {
"@nuxtjs/auth": "^4.9.1",
"@nuxtjs/axios": "^5.12.2",
"dotenv": "^8.2.0",
"@nuxtjs/auth-next": "^5.0.0-1622918202.e815752",
"@nuxtjs/axios": "^5.13.6",
"dotenv": "^10.0.0",
"normalize.css": "^8.0.1",
"nuxt-start": "^2.14.3"
"nuxt-start": "^2.15.6"
},
"devDependencies": {
"nuxt": "^2.14.3"
"nuxt": "^2.15.6"
}
}
Loading