sveltejs / sveltejs/kit

Feature - Ability for client to detect or respond to redirects

Open
#13,435 12 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

router
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

From what I can tell, there's no way to reliably detect a redirect in client application code.

Describe the proposed solution

Ideally there'd be a way to detect a redirect, either as a hook or maybe even as a piece of the data included in the Navigation type.

Alternatives considered

I looked to see if this data was available in the navigating type from $app/state, checked to see if it was available in client hooks, and tried to see if I could just use document.referrer, to no avail.

Importance

would make my life easier

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Navigation type, the navigating type from $app/state, client hooks, and document.referrer, which the report identifies as possible entry points. Determine how client application code could reliably detect or respond to redirects, then verify that the chosen hook or navigation data exposes this information consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.