Skip to content
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

Remove dotenv from auth0 Next.js example #15398

Merged
merged 14 commits into from
Aug 2, 2020
Merged
Show file tree
Hide file tree
Changes from 8 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
11 changes: 11 additions & 0 deletions examples/auth0/.env.local..example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#Settings exposed to the client.
lfades marked this conversation as resolved.
Show resolved Hide resolved
lfades marked this conversation as resolved.
Show resolved Hide resolved
NEXT_PUBLIC_AUTH0_CLIENT_ID=
NEXT_PUBLIC_AUTH0_SCOPE=
NEXT_PUBLIC_AUTH0_DOMAIN=
NEXT_PUBLIC_REDIRECT_URI=
NEXT_PUBLIC_POST_LOGOUT_REDIRECT_URI=
lfades marked this conversation as resolved.
Show resolved Hide resolved

# Settings exposed to the server.
lfades marked this conversation as resolved.
Show resolved Hide resolved
AUTH0_CLIENT_SECRET=
SESSION_COOKIE_SECRET=
SESSION_COOKIE_LIFETIME=
6 changes: 0 additions & 6 deletions examples/auth0/.env.template

This file was deleted.

3 changes: 0 additions & 3 deletions examples/auth0/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# auth0 env
.env

# local env files
.env.local
.env.development.local
Expand Down
21 changes: 12 additions & 9 deletions examples/auth0/lib/auth0.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { initAuth0 } from '@auth0/nextjs-auth0'
import config from './config'

export default initAuth0({
clientId: config.AUTH0_CLIENT_ID,
clientSecret: config.AUTH0_CLIENT_SECRET,
scope: config.AUTH0_SCOPE,
domain: config.AUTH0_DOMAIN,
redirectUri: config.REDIRECT_URI,
postLogoutRedirectUri: config.POST_LOGOUT_REDIRECT_URI,
clientId: process.env.NEXT_PUBLIC_AUTH0_CLIENT_ID,
clientSecret: process.env.AUTH0_CLIENT_SECRET,
scope: process.env.NEXT_PUBLIC_AUTH0_SCOPE || 'openid profile',
domain: process.env.NEXT_PUBLIC_AUTH0_DOMAIN,
redirectUri:
process.env.NEXT_PUBLIC_REDIRECT_URI ||
'http://localhost:3000/api/callback',
postLogoutRedirectUri:
process.env.NEXT_PUBLIC_POST_LOGOUT_REDIRECT_URI ||
'http://localhost:3000/',
session: {
cookieSecret: config.SESSION_COOKIE_SECRET,
cookieLifetime: config.SESSION_COOKIE_LIFETIME,
cookieSecret: process.env.SESSION_COOKIE_SECRET,
cookieLifetime: 7200,
lfades marked this conversation as resolved.
Show resolved Hide resolved
},
})
26 changes: 0 additions & 26 deletions examples/auth0/lib/config.js

This file was deleted.

17 changes: 0 additions & 17 deletions examples/auth0/next.config.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/auth0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"license": "MIT",
"dependencies": {
"@auth0/nextjs-auth0": "^0.6.0",
"dotenv": "^8.2.0",
"next": "latest",
"react": "^16.12.0",
"react-dom": "^16.12.0"
Expand Down