forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dotenv from auth0 Next.js example (vercel#15398)
We should remove the dotenv dependency from all Next.js examples (in favor of Next.js environment support): vercel#15225
- Loading branch information
1 parent
8e1bdaa
commit 86b92e7
Showing
9 changed files
with
47 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Public Environment variables that can be used in the browser. | ||
NEXT_PUBLIC_AUTH0_CLIENT_ID= | ||
NEXT_PUBLIC_AUTH0_SCOPE="openid profile" | ||
NEXT_PUBLIC_AUTH0_DOMAIN= | ||
NEXT_PUBLIC_REDIRECT_URI="http://localhost:3000/api/callback" | ||
NEXT_PUBLIC_POST_LOGOUT_REDIRECT_URI="http://localhost:3000" | ||
|
||
# Secret environment variables only available to Node.js | ||
AUTH0_CLIENT_SECRET= | ||
SESSION_COOKIE_SECRET= | ||
SESSION_COOKIE_LIFETIME=7200 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Number(process.env.SESSION_COOKIE_LIFETIME) || 7200, | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.