Auto login: Is there a sample on how saving credentials at local DB and recovering that each time user open the app?
Also, how to prevent user to push the back button and get back to login page accidentally?
Auto login: Is there a sample on how saving credentials at local DB and recovering that each time user open the app?
Also, how to prevent user to push the back button and get back to login page accidentally?
Hello Ricardo,
You can set login/password to localStorage variables and check them of the startScreen. If they aren't empty - login him automatically. Also, you can set $scope variable which you can check on each page and hide back button according to that value
How secure is this approach?
Is this something that is commonly coded?
Is there a more "secure" way?
Thanks.
There are no more secure sollution for the saving user's name/password on the device. You can set "Session expiration" more than 1 day, so user's session token would be alive a long time, without saving his password
Hi! I could auto logon. Now I need clean up the navigation history after logon to prevent user to go back to the login page (because the Android back button is always there).
I tried the both samples below, but it didn't work.
Syntax on Logon Page
pre
var $ionicHistory = Apperyio.get("$ionicHistory");
$ionicHistory.nextViewOptions({
historyRoot : true,
disableBack: true
});
/pre
or syntax after logon page
pre
var $ionicHistory = Apperyio.get("$ionicHistory");
$ionicHistory.clearHistory()
/pre
From this reference: http://ionicframework.com/docs/api/se...
I just found another solution here but I'm curious why $ionicHistory didn't worked?
Any update on the above query? injecting $ionicHistory into controller does not seem to work
Hello Martand,
Could you clarify what you have tried and what exactly does not work?