-
Notifications
You must be signed in to change notification settings - Fork 98
Improve redirectTo behavior #154
Copy link
Copy link
Closed
Labels
breaking changesChange that can breaking existing codeChange that can breaking existing codefeatureNew functionality or improvementNew functionality or improvementsupportQuestions, discussions, and general supportQuestions, discussions, and general support
Metadata
Metadata
Assignees
Labels
breaking changesChange that can breaking existing codeChange that can breaking existing codefeatureNew functionality or improvementNew functionality or improvementsupportQuestions, discussions, and general supportQuestions, discussions, and general support
The
redirectTofeature is great, but it is way too eager to activate and does not respect theauth.modeof routes.From the docs:
And also:
This is all needlessly silly and complicated. I bet at least 95% of the time what people want is for
redirectToto only affect requests whose auth mode isrequired.Currently I have to add this to every single route where auth is
optional.I'm failing to think of a scenario where I would want
redirectToandoptional/trytogether. But if there is one, it is definitely not the common case.I propose that
redirectToonly triggers forrequiredauth. We could have aredirectOnTry: trueto re-enable the old behavior, but it's still a breaking change. And with the new behavior, I'm not sure anyone actually even needs theredirectOnTryoption at all.