Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect not working when adding custom status to response #34

Open
jahvi opened this issue Dec 10, 2024 · 2 comments
Open

Redirect not working when adding custom status to response #34

jahvi opened this issue Dec 10, 2024 · 2 comments

Comments

@jahvi
Copy link

jahvi commented Dec 10, 2024

When I try returning a redirectWithError with a custom status I get my toast notification displayed just fine but the actual redirect doesn't happen. If I remove the custom status code it works as expected.

Eg, this works:

return redirectWithError("/my-page", "Error");

But this doesn't:

return redirectWithError("/my-page", "Error", { status: 400 });

Do I need to handle merging the headers?

I'm using v1.2.2

@bravo-kernel
Copy link

Same for dataWithError, without the status code the toast functions as expected.

@AlemTuzlak
Copy link
Contributor

@jahvi I'm pretty sure the reason behind it is that you rewrite the redirect status code which is 403 and react router doesn't pick it up as a redirect probably, but dataWithError should work fine, would you mind creating a minimum repro and i'll look at it and see if it's the libraries fault or not. Maybe it's something with the fact that the behaviors changed with rr7 slightly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants