Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relative URL for Signin page callbackUrl #4534

Merged
merged 4 commits into from May 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next-auth/src/next/middleware.ts
Expand Up @@ -91,7 +91,7 @@ async function handleMiddleware(

// the user is not logged in, redirect to the sign-in page
const signInUrl = new URL(signInPage, req.nextUrl.origin)
signInUrl.searchParams.append("callbackUrl", req.url)
signInUrl.searchParams.append("callbackUrl", `${req.nextUrl.pathname}${req.nextUrl.search}`)
return NextResponse.redirect(signInUrl)
}

Expand Down