Kashisaz98
Kashisaz98

Reputation: 51

How to stop angularjs work ofter user logs off in ASP.Net MVC

I have a request page which every users have access to it but everyone can access to their own requests and can change it with some functions that work with AngularJS. The thing is that if the user logs out in another page, while the user haven't refreshed this page angular functions are continuing to work. I know I can Check the loged in user in the controller, but is there any way that angular prevent it? (I Use ASP.Net Authentication and MVC)

Upvotes: 0

Views: 31

Answers (1)

Ghazanfar Khan
Ghazanfar Khan

Reputation: 3718

You have to use some sort of communication channel such as signal r or sockets to achieve that. One solution could be to intercept http request and check if the user is login. If isn't navigate to login page.

Upvotes: 1

Related Questions