Hi, I think I was using useServerFn the right way, but it won't redirect... Pls advise
3 Replies
flat-fuchsia•3mo ago
I think this is related to this: https://github.com/TanStack/router/issues/4460. If you create a middleware which check what is returned by the handler like that:
if you console.log the result you can see that the redirect "error" is not thrown, so you need to do has shown and the redirect should work.
foreign-sapphireOP•3mo ago
Thank you for your help. Can't test it though, because the server-function turned into a get request, although its method is set to POST...
flat-fuchsia•3mo ago
Ok, I'm not sure this is related but I think the middleware should come before the validator in your loginFn (maybe it does not matter ^^) ?