- Go to Auth0 and create a new application of type "Regular Web Application"
- Skip the Quickstart
- Copy the
Issuer
,Client ID
andClient Secret
to the clipboard - Rename the
.env.example
file to.env
- Paste the credentials into the
.env
file - Set the Callback URL on Auth0 to http://localhost:9991/auth/cookie/callback/auth0
Install the dependencies and run the complete example in one command:
npm install && npm start
On the NextJS frontend, click the "Login" button. Once the login is complete, the Frontend will automatically fetch the data and inject the bearer token into the origin request.
Check out the .wundergraph/wundergraph.server.ts
file.
We've added a global onRequest hook to inject the raw ID token of the user into the origin request.
You can modify this logic and add other Headers into your origin requests.
Read the Docs.
Join us on Discord!