Skip to content

Commit 430ae0c

Browse files
committed
hard code redirect origin
1 parent ac8695b commit 430ae0c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app/auth/callback/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { cookies } from 'next/headers'
66
* Auth callback route for handling OAuth redirects
77
*/
88
export async function GET(request: Request) {
9-
const { searchParams, origin } = new URL(request.url)
9+
const { searchParams } = new URL(request.url)
1010
const code = searchParams.get('code')
1111
// if "next" is in param, use it as the redirect URL
1212
const next = searchParams.get('next') ?? '/dashboard/search' // Default redirect to dashboard
@@ -86,15 +86,15 @@ export async function GET(request: Request) {
8686
}
8787

8888
// Redirect based on 'next' parameter or default
89-
return NextResponse.redirect(`${origin}${next}`)
89+
return NextResponse.redirect(`https://airankia.com${next}`)
9090
} else {
9191
console.error("Auth Callback Error:", error.message)
9292
// Optionally redirect to an error page
93-
return NextResponse.redirect(`${origin}/login`)
93+
return NextResponse.redirect(`https://airankia.com/login`)
9494
}
9595
}
9696

9797
// return the user to an error page with instructions
9898
console.error("Auth Callback Error: No code received or exchange failed.")
99-
return NextResponse.redirect(`${origin}/login`)
99+
return NextResponse.redirect(`https://airankia.com/login`)
100100
}

0 commit comments

Comments
 (0)