Replies: 4 comments 1 reply
-
Same here. My use case: During login, some users are required to setup an MFA device. From my auth service I get a response if the login was either successful or if MFA setup is needed (along with the MFA secret for setup). Based on this I would like to redirect the user to the main page on login success or to an mfa-setup page if needed. However I need to send the MFA setup data along with the redirect. A redirect should be basically a 302 response. I can attach data to this response like in the following example, but I haven't found a way to read this data on the new route. return new Response(JSON.stringify({ foo: "bar" }), {
status: 302,
headers: {
"Content-Type": "application/json; utf-8",
Location: "/mfa-setup",
},
}); So my feature request is to add a way to read data sent with a redirect on the redirected page. |
Beta Was this translation helpful? Give feedback.
-
Same here. Right now I just return data from action and use navigate() in useEffect. Looks very dirty, but until redirect can accept state, I guess this is the only way |
Beta Was this translation helpful? Give feedback.
-
I'm also wishing for a feature like this. I have an issue where I'm trying to perform actions in react-admin custom routes and I have to target the root admin route but then I can't get action errors in the admin subroutes so I was hoping I could redirect to the subroutes with the action data. |
Beta Was this translation helpful? Give feedback.
-
Same here:
The Problem:
Yes, we can redirect to |
Beta Was this translation helpful? Give feedback.
-
Use case:
The user filled the sign up form,
The
action
processed the request and we sent a validation email.Next we need to redirect the user to a friendly page to let them know about the validation email.
How can we, from inside an action, redirect to the validate page, with some data from the POST request (name, email).
I was looking for something like
navigate
with state and avoid query/path paramsBeta Was this translation helpful? Give feedback.
All reactions