Allowing only certain routes to be accessed from outside

Hello, I’m using last version (svelte).

I have enabled the browserHistory on main View and that allows users to go to certains routes of my app from a link. The problem is that there’s users that save the current path as bookmark and then try to access my pwa through there and that leads me to certain auth issues.

So, what I need to know is how to allow, for example ‘!/event/123456’ but automatically redirect any other try to enter another url like ‘!/userprofile’.

I would love to be able to work without virtual routes (and browserhistory), but have some exceptions (for the events paths)

You can use route’s async prop and resolve its component with another one if user is not authorised Routes | Framework7 Documentation

1 Like

Yes, I’ve thinked on that, but the problem is that I have no way to check if the user went to that page by typing it on the address bar or by internal routing or linking.

Any ideas?


I used the store to save the logged in state and it worked.