T
TanStack10mo ago
stormy-gold

Route rewrite before route parsing?

Our hash-based routing app is called by an external system which we can't change and which adds an additional # to our url, which has to be removed before the router parses the route. The app is called under foo.com/draft/#/login?#access_token=eyJhb . As you can see, there is one # too much before access_token. How can we rewrite the route before the router does the parsing to remove this second # ?
No description
5 Replies
passive-yellow
passive-yellow10mo ago
how does router interpret this url right now? is there a search param that starts with a hash?
stormy-gold
stormy-goldOP10mo ago
search is empty
No description
stormy-gold
stormy-goldOP10mo ago
once i remove the second # everything wors as expected I'd expect to rewrite the route (string) by replacing login?#access_token with login?access_token ?!
passive-yellow
passive-yellow10mo ago
hm not sure where that would take place you could do this outside of router parse the url, if this second hash occurs, redirect to a correct url by "outside" I mean in JS but not relying on any router functionality
stormy-gold
stormy-goldOP10mo ago
hm jeah, that'd be a workaround. So there's no hook to modify that?

Did you find this page helpful?