lukeed / svelte-demo

Multi-page demo built Svelte 3.x and Rollup with code-splitting
MIT License
114 stars 19 forks source link

Decode URI for the params #7

Closed nitroboy720 closed 4 years ago

nitroboy720 commented 4 years ago

For url parameters that have some special characters encoded in, you should decode them before setting them as the params.

For example, on a login page that has a nextUrl to redirect to, the nextUrl param probably has some special characters that need decoding.

Solution would be rather simple, juste use the function decodeURIComponent() on each of the received params.

Edit: I should probably have posted this on the navaid repo itself

lukeed commented 4 years ago

Hey,

This is a basic, overly simplistic demo. Decoding (or not decoding) is specific to your app.

This applies to navaid too & it's why it doesn't auto-decode by default. Your app may (or may not) want that.

Thank you though :)