I want to redirect the users, to their user profile page, after they successfully login (or their login is successfully authenticated). I take the users to their profile pages through the dynamic hyper link below:
#/{{getAccountTypeName($parent.user.account_type)}}/{{$parent.user.handle}}
And I've located where my users are authenticated at login. But How can I take a dynamically populated URL such as above, in angular JS and call it as a redirect in the below authentication statement. (I am new to angular)
var email = $scope.loginForm.email;
var password = $scope.loginForm.password;
auth.login(
email,
password,
function (data) {
if (data.success == true) {
$scope.initLogin();
$scope.loginCallback(data);
$scope.showWelcome = true;
addPointsLogin();
$("#welcomeModal").modal();
$scope.cancel = function () {
$("#welcomeModal").modal("hide");
};
}
else {
alert(data.error_message);
}
}