Skip to content

Comments

fix(core): resolve signin URL correctly on error page#13379

Open
kaigritun wants to merge 1 commit intonextauthjs:mainfrom
kaigritun:fix/error-page-signin-link
Open

fix(core): resolve signin URL correctly on error page#13379
kaigritun wants to merge 1 commit intonextauthjs:mainfrom
kaigritun:fix/error-page-signin-link

Conversation

@kaigritun
Copy link

Summary

Fixes #13204

The signin link on the error page was incorrectly constructed using string concatenation:

const signinPageUrl = `${url}/signin`

When the URL is /auth/error?error=AccessDenied, this results in the malformed URL:
/auth/error?error=AccessDenied/signin

Changes

Changed to use the URL constructor to properly resolve the signin path:

const signinPageUrl = url ? new URL("signin", url).href : "/signin"

This correctly produces /auth/signin regardless of query parameters in the current URL.

Testing

Added test case in pages.test.ts to verify the signin link is generated correctly on the error page.

Previously, the signin link on the error page was constructed by string
concatenation, resulting in malformed URLs like:
/auth/error?error=AccessDenied/signin

This fix uses the URL constructor to properly resolve the signin path
relative to the base URL.

Closes nextauthjs#13204
@vercel
Copy link

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
auth-docs Ready Ready Preview, Comment Feb 12, 2026 0:12am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
next-auth-docs Ignored Ignored Preview Feb 12, 2026 0:12am

Request Review

@vercel
Copy link

vercel bot commented Feb 12, 2026

Someone is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Refers to `@auth/core`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Malformed sign-in link on default error page

1 participant