T
TanStack13mo ago
metropolitan-bronze

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
vicious-gold
vicious-gold13mo ago
how does router interpret this url right now? is there a search param that starts with a hash?
metropolitan-bronze
metropolitan-bronzeOP13mo ago
search is empty
No description
metropolitan-bronze
metropolitan-bronzeOP13mo 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 ?!
vicious-gold
vicious-gold13mo 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
metropolitan-bronze
metropolitan-bronzeOP13mo ago
hm jeah, that'd be a workaround. So there's no hook to modify that?

Did you find this page helpful?