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

I would need to redirect a user on a specific route based on the user's role #9224


User avatar
0
datalab created

hi, I would need to redirect a user on a specific route based on the user's role, becouse i have utilized the roles system that customize the navigation menu base on role. when user login the user is redirect to nofications pages, it possible tu redirect user to specific route base on it roles ?

Best Regards


2 Answer(s)
  • User Avatar
    0
    musa.demir created

    There are alot of way to do that. For example: If your app is mvc you can change return url here by users role: https://github.com/aspnetzero/aspnet-zero-core/blob/51233d56669623ad85186cb80371489ed15ea5c1/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Mvc/Controllers/AccountController.cs#L231

    If your app is angular you can change return url here by users role: https://github.com/aspnetzero/aspnet-zero-core/blob/51233d56669623ad85186cb80371489ed15ea5c1/angular/src/account/login/login.service.ts#L215

  • User Avatar
    0
    datalab created

    Tankyou i have revolded add my custom check here https://github.com/aspnetzero/aspnet-zero-core/blob/51233d56669623ad85186cb80371489ed15ea5c1/angular/src/app/shared/common/auth/auth-route-guard.ts#L94