Skip to content

feat(admin): Return to the current page after re-signing in - #754

Closed
aXenDeveloper wants to merge 1 commit into
canaryfrom
claude/admin-panel-redirect-url-moijzb
Closed

feat(admin): Return to the current page after re-signing in#754
aXenDeveloper wants to merge 1 commit into
canaryfrom
claude/admin-panel-redirect-url-moijzb

Conversation

@aXenDeveloper

Copy link
Copy Markdown
Owner

When an admin session expires, the AdminCP now remembers the page the
admin was on as a ?redirect= query on the sign-in URL and sends them
back there after signing in, instead of always landing on the dashboard.

The Proxy stamps every request with x-vitnode-pathname (pathname plus
query, locale prefix stripped), since a Server Component only ever sees
the rewritten internal URL. getSessionAdminApi reads it when the
session check fails, and the sign-in form carries the value through to
the Server Action.

The value is untrusted on both hops, so it is validated twice: only
locale-less paths under /admin survive, which keeps an absolute or
protocol-relative URL, a .. segment, or the sign-in page itself from
turning sign-in into an open redirect or a loop.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01SUTFv2hU42T1XJ7wU6vGjx

When an admin session expires, the AdminCP now remembers the page the
admin was on as a `?redirect=` query on the sign-in URL and sends them
back there after signing in, instead of always landing on the dashboard.

The Proxy stamps every request with `x-vitnode-pathname` (pathname plus
query, locale prefix stripped), since a Server Component only ever sees
the rewritten internal URL. `getSessionAdminApi` reads it when the
session check fails, and the sign-in form carries the value through to
the Server Action.

The value is untrusted on both hops, so it is validated twice: only
locale-less paths under `/admin` survive, which keeps an absolute or
protocol-relative URL, a `..` segment, or the sign-in page itself from
turning sign-in into an open redirect or a loop.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SUTFv2hU42T1XJ7wU6vGjx
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
vitnode-docs Error Error Aug 23, 2026 8:45am

@github-actions github-actions Bot added the 💡 Feature A new feature label Aug 23, 2026
@aXenDeveloper
aXenDeveloper deleted the claude/admin-panel-redirect-url-moijzb branch August 23, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💡 Feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants