How to remove a view from ionicHistory?

My app’s history for a particular section look like this.
View A --> Login --> View B
When I press back button from View B, it is going to Login. But I don’t want to show the login page again, as the user is already logged in. How to remove this particular view from ionic history?

In .run() you add this code :

$rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams){
    if("Login") ionicHistory.removeBackView();