When I receive password reset instructions in my app, the URL I use to go to the server looks like this:
/changepass?key=1231231231212312
In the controller, I have the following code:
if (typeof $routeParams.key !== 'undefined') {
$scope.changePassword();
}
However, after changing the password and trying to login on the same view, I am directed to a different location with the ?key=123123123
still in the URL. What mistake did I make and how can I navigate to /company without any keys?
$scope.login = function() {
***
$location.path('/company');
***
};
I also attempted
$scope.$apply($location.path('/company'));
but even then, the params are present in the URL when navigating to the company after logging in.
How can I resolve this issue?
In routing:
.when('/signin', {
templateUrl: 'views/authorization.html',
controller: 'AuthorizationCtrl'
})
.when('/changepass', {
templateUrl: 'views/authorization.html',
controller: 'AuthorizationCtrl'
})