Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Redirect to specific module does not work #4345


User avatar
0
antonis created

I have several modules in my angular 4 app. User test is given access only to Clients section (Clients lazy load module). I changed auth-route-guard.ts so that once test user is logged in redirected to dashboard

selectBestRoute(): string {
      
        if (!this._sessionService.user) {
            return '/account/login';
        }
       
        if (this._permissionChecker.isGranted('Pages.Administration.Host.Dashboard')) {
            return '/app/admin/hostDashboard';
        }

        if (this._permissionChecker.isGranted('Pages.Tenant.Dashboard')) {
            return '/app/main/dashboard';
        }

        if (this._permissionChecker.isGranted('Pages.Tenants')) {
            return '/app/admin/tenants';
        }

        if (this._permissionChecker.isGranted('Pages.Administration.Users')) {
            return '/app/admin/users';
        }

        if (this._permissionChecker.isGranted('Pages.Clients.Dashboard')) {
            return '/app/clients/dashboard';
        }
      
        return '/app/notifications';
    }

The breakpoint goes inside the Pages.Clients.Dashboard condition but I see blank page no errors nothing.


1 Answer(s)
  • User Avatar
    0
    alirizaadiyahsi created

    Hi @antonis ,

    What is going on if you manually browse yourdomain.com/app/clients/dashboard ? Did you look at the logs? And also could you share your code that is using selectBestRoute() to understand better the problem?