redirect to desired page after success login in AngularJS with c# MVC

Mar 18 2021 3:27 AM
I have an AngularJS application. Here we have two separate pages
for ex: http://localhost/#!/home/ and http://localhost/#!/admin/params=abc/
The authentication is happening on .Net MVC controller page (.cs file)
If user hit the application url in browser, application navigates to authentication page and after successful login navigates the user to "http://localhost/#!/home/"
If adminUser hit this specific URL "http://localhost/#!/admin/params=abc/" then application navigates to authentication page and after successful login it navigates the user to home page i.e. to "http://localhost/#!/home/". Which is what I dont want in this case.
But as per my requirement, the application should go to admin home page which is "http://localhost/#!/admin/params=abc/"
I am using $stateProvider.state for routing. I have tried to capture the URL inside app.js file but before hitting this page application gets navigated to authentication page. I am not sure how to configure this.
Can anyone help me where should I configure? Provide any samples. Appreciate your help on this.

Answers (1)