nuxt/nuxt

avoid redirect loops

Open

#13 565 ouverte le 28 mars 2022

Voir sur GitHub
 (7 commentaires) (7 réactions) (0 assignés)TypeScript (60 221 stars) (5 607 forks)batch import
good first issue🍰 p2-nice-to-have

Description

Reference: https://github.com/nuxt/framework/pull/3908#issuecomment-1079665687

With redirectTo, it is possible to make a loop condition return navigateTo(to.path).

A simple fix would be check and avoid redirect to exact same URL.

In more complex cases, a redirect loop can be nested like a~>b~>a which we could implement with help of a persisted state. (we can wait for this until having session support and benefit from session to hold such state)

Guide contributeur