0

I have an Angular 10 application I am writing, with a main component at path

{ path: 'main/:value's, component: MainPage}

Where :value is a uid to the component they are trying to access. Currently I am setting a bearer token in session storage on login page, and kick them to login page if they try to go to /main/:value without authorization.

However, after logging in users can manually edit the URL to change :value and navigate to pages they are not allowed to. How can I kick them back to the login page when they try to do this?

Tried using Angular can activate routeGuard, but it looks like that's deprecated.

Jami
  • 1
  • 1
    Check if one of those questions help you: https://stackoverflow.com/questions/72021906/same-path-but-different-guard or https://stackoverflow.com/questions/65764988/angular-routing-same-path-different-guard – Alexander Santos Feb 24 '23 at 17:40

0 Answers0