svelte-router icon indicating copy to clipboard operation
svelte-router copied to clipboard

onlyIf guard is not fully working for 404 route

Open CatchABus opened this issue 4 years ago • 1 comments
trafficstars

In the case of 404, if a user hits /404 on browser, its registered route guard will work (if any).

However, if one is redirected from a non-existent page like /frerdfdfds to /404, then route /404 will ignore its own guard. This is bad on apps with a login page. One usually does not want 404 to show up on login pages because strangers can exploit it to guess route paths that are only accessible through authentication randomly, so guard is very important in such a case.

CatchABus avatar Jun 02 '21 22:06 CatchABus

Also, I have worked on a way to make fix this here: https://github.com/DimitrisRK/svelte-router/tree/404-redirect

CatchABus avatar Jun 05 '21 08:06 CatchABus