@winningtech wrote:
I have a couple pages in my app which require authentication, and several that don’t. Instead of making everyone login, I’ve set up an AuthGuard that restricts access to those to pages. This is working as expected.
I now want to pass data to my login page so that, after login, the user is redirected to the page they are trying to access. I’m unsure on how to do this.
From what I could find, I pass the value in via
data
{ path: 'map', loadChildren: './map/map.module#MapPageModule', canActivate: [AuthGuard], data: { page: 'map' } }
But how do I read this on my login page so I can send them to the proper page, something like this?
if( data == 'map') { this.router.navigate(['/map']); }
Posts: 2
Participants: 2