You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However when calling toString on an instance of UrlSearchParams the resulting string is url encoded, and it appears that the string returned as redirect is also encoded causing it to be encoded twice.
Describe the proposed solution
The most awesome approach would be kit detecting this issue and when compiling inserting decodeURI
However this could be argued as inelegant, as it would both be an unnecessary property in 90% of the load cases, and it would be difficult it you wanted to preserve the existing query, and append a parameter
Importance
would make my life easier
Additional Information
As a minimum I would suggest updating the docs here to make it clear that the string is url encoded and you don't have to do it on your end.
The text was updated successfully, but these errors were encountered:
In my opinion, the most user friendly thing would be to not automatically encode the redirect url in the first place, that seems like some unexpected magic to me.
Agreed. I just got bitten by this and it took a long time to track down the issue. This sort of auto encoding isn't standard or expected as far as I know. And you'd think generating the query from URLSearchParams should be supported, but right now it isn't. I'd call this a bug, not just lack of documentation.
Describe the problem
I just spent a lot of time debugging an issue where apparently our url query was being url encoded twice.
The issue stemmed from the following approach in a load function
However when calling
toString
on an instance ofUrlSearchParams
the resulting string is url encoded, and it appears that the string returned asredirect
is also encoded causing it to be encoded twice.Describe the proposed solution
The most awesome approach would be kit detecting this issue and when compiling inserting
decodeURI
However you could argue that this would be too much "magic".
Alternatives considered
An alternative approach could be a secondary argument for the return type of a load function that preserves existing query params on redirect
However this could be argued as inelegant, as it would both be an unnecessary property in 90% of the load cases, and it would be difficult it you wanted to preserve the existing query, and append a parameter
Importance
would make my life easier
Additional Information
As a minimum I would suggest updating the docs here to make it clear that the string is url encoded and you don't have to do it on your end.
The text was updated successfully, but these errors were encountered: