Skip to content

Commit

Permalink
docs: add note about onRequest middleware exported from `serverAuth…
Browse files Browse the repository at this point in the history
…$` (#5264)
  • Loading branch information
jakovljevic-mladen authored Oct 4, 2023
1 parent 895babe commit fb62a4b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/docs/src/routes/docs/integrations/authjs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ export const { onRequest, useAuthSession, useAuthSignin, useAuthSignout } = serv
})
);
```

> *IMPORTANT*: Make sure to keep the `onRequest` export as it is used to handle the oAuth flow redirects. Once the user finished oAuth flow, GitHub (or any other provider) will redirect the user back to the application to `/api/auth/callback/github` (or `/api/auth/callback/[otherProvider]`). The `onRequest` middleware function will handle requests to this endpoint and finish the oAuth flow.
3. Create or edit the `.env.local` file at the root of your project to store secrets

```bash title=".env.local"
Expand Down

0 comments on commit fb62a4b

Please sign in to comment.