Skip to content

Commit 95ba058

Browse files
committed
Changing the way how lib/auth0 is imported in EXAMPLES.md
1 parent b6b1b66 commit 95ba058

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

EXAMPLES.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ In middleware, the `getAccessToken(req, res)` helper can be used to get an acces
455455
```tsx
456456
import { NextRequest, NextResponse } from "next/server"
457457

458-
import { auth0 } from "@/lib/auth0"
458+
import { auth0 } from "./lib/auth0" // Adjust path if your auth0 client is elsewhere
459459
460460
export async function middleware(request: NextRequest) {
461461
const authRes = await auth0.middleware(request)
@@ -486,7 +486,7 @@ If you are using the Pages Router and are calling the `getAccessToken` method in
486486
```ts
487487
import { NextRequest, NextResponse } from "next/server"
488488

489-
import { auth0 } from "@/lib/auth0"
489+
import { auth0 } from "./lib/auth0" // Adjust path if your auth0 client is elsewhere
490490
491491
export async function middleware(request: NextRequest) {
492492
const authRes = await auth0.middleware(request)
@@ -589,7 +589,7 @@ You can wrap your components in an `<Auth0Provider />` and pass an initial user
589589
```tsx
590590
import { Auth0Provider } from "@auth0/nextjs-auth0"
591591

592-
import { auth0 } from "@/lib/auth0"
592+
import { auth0 } from "./lib/auth0" // Adjust path if your auth0 client is elsewhere
593593
594594
export default async function RootLayout({
595595
children,
@@ -991,7 +991,7 @@ For example:
991991
```ts
992992
import { NextResponse } from "next/server"
993993

994-
import { auth0 } from "@/lib/auth0"
994+
import { auth0 } from "./lib/auth0" // Adjust path if your auth0 client is elsewhere
995995
996996
export async function GET() {
997997
try {
@@ -1016,7 +1016,7 @@ On the server, the `getAccessTokenForConnection({}, req, res)` helper can be use
10161016
```ts
10171017
import type { NextApiRequest, NextApiResponse } from "next"
10181018

1019-
import { auth0 } from "@/lib/auth0"
1019+
import { auth0 } from "./lib/auth0" // Adjust path if your auth0 client is elsewhere
10201020
10211021
export default async function handler(
10221022
req: NextApiRequest,
@@ -1039,7 +1039,7 @@ In middleware, the `getAccessTokenForConnection({}, req, res)` helper can be use
10391039
```tsx
10401040
import { NextRequest, NextResponse } from "next/server"
10411041

1042-
import { auth0 } from "@/lib/auth0"
1042+
import { auth0 } from "./lib/auth0" // Adjust path if your auth0 client is elsewhere
10431043
10441044
export async function middleware(request: NextRequest) {
10451045
const authRes = await auth0.middleware(request)
@@ -1070,7 +1070,7 @@ If you are using the Pages Router and are calling the `getAccessTokenForConnecti
10701070
```ts
10711071
import { NextRequest, NextResponse } from "next/server"
10721072

1073-
import { auth0 } from "@/lib/auth0"
1073+
import { auth0 } from "./lib/auth0" // Adjust path if your auth0 client is elsewhere
10741074
10751075
export async function middleware(request: NextRequest) {
10761076
const authRes = await auth0.middleware(request)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export const config = {
9797
You can now begin to authenticate your users by redirecting them to your application's `/auth/login` route:
9898

9999
```tsx
100-
import { auth0 } from "@/lib/auth0"
100+
import { auth0 } from "./lib/auth0" // Adjust path if your auth0 client is elsewhere
101101
102102
export default async function Home() {
103103
const session = await auth0.getSession()

V4_MIGRATION_GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ By default, **the middleware does not protect any routes**. To protect a page, y
9797

9898
```ts
9999
export async function middleware(request) {
100-
const authRes = await auth0.middleware(request); //Returns a NextResponse object
100+
const authRes = await auth0.middleware(request); // Returns a NextResponse object
101101

102102
// Ensure our own middleware does not handle the `/auth` routes, auto-mounted and handled by the SDK
103103
if (request.nextUrl.pathname.startsWith("/auth")) {
@@ -155,7 +155,7 @@ On the server-side, the `getSession()` method can be used to check if the user i
155155
```tsx
156156
// Example for an App Router Server Component
157157
import { redirect } from 'next/navigation'
158-
import { auth0 } from '@/lib/auth0' // Adjust path if your auth0 client is elsewhere
158+
import { auth0 } from './lib/auth0' // Adjust path if your auth0 client is elsewhere
159159
160160
export default async function Page() {
161161
const session = await auth0.getSession()

0 commit comments

Comments
 (0)