i have implemented login system on my app.i am storing auth token on local storage.everything work fine once login is ok.
but every time i close the app and opens, login page pops up.how do i bypass login page when the user token is already exist on local storage.
my app structure goes like this:loginpage–>welcome page–>home page
$urlRouterProvider.otherwise(’/loginpage’);
if users token exists on local storage,i want to forward the page to welcome page.how do i implement this.
try removing the $ionicConfigProvider parameter And the $ionicConfigProvider.prefetchtempaltes(false) statement from your code, it isn’t neccesaary for this to run.
Didnt work out bro .Is this works for you.infact i cannot even add any parameters on .config function.everything is showing as error as showed you on image.
If the run block I need to use a service (which makes an http.get), that is correct operation, the response of the service must come before continue with the routing.
As implemented using this scheme stateChangeStart?
I try to use the service outside in run since achieved with use at startup, not on each subsequent routing. But without the service response, continuous. That is a problem of asynchronism between the service and routing.
Alternatives? Some example of login at an external server ($ http) not only localStorage?
hiii guys, i am aswin … i am also facing a same trouble… i created a app and launched in playstore… user felt struggle to give numerous login when close my application… now i blind to solve this problem… Give some ideas and suggestion to fix this problem