Hi all!
I was looking for good code for ionic login issue if I wanted to do it not with google/facebook,
I found some code for refrense GitHub - keithdmoore/ionic-http-auth: An ionic-starter-project to show how the angular-http-auth library can be used for authentication.
I did some code but looks I have 2 issues,
the first one the redrect not working after login
the error
Error: Cannot transition to abstract state ‘app’
the code
.controller('LoginCtrl', function ($scope, $state, AuthenticationService) {
$scope.message = "";
$scope.user = {
username: null,
password: null
};
$scope.login = function () {
AuthenticationService.login($scope.user);
};
$scope.$on('event:auth-loginRequired', function (e, rejection) {
console.log('handling login required');
$scope.loginModal.show();
});
$scope.$on('event:auth-loginConfirmed', function () {
$scope.username = null;
$scope.password = null;
$state.go('app');
});
the app
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html",
controller: 'AppCtrl'
})
.state('app.placeslists', {
url: "/placeslists",
cache: false,
views: {
'menuContent': {
templateUrl: "templates/placeslists.html",
controller: 'PlaceslistsCtrl'
}
}
})
and the second issue how can I do what urls need to be after login and what not.
thanks!