javascript - Regularly signed out when using firebase authWithPassword -


i have phonegap app on ios using firebase authentication. logging in done so:

  var afterlogin = function(error, authdata) {     if (error) {        console.log(error);        messenger.error(error.message);       return;     }     $scope.loggedin = $auth.check();     $scope.$apply();      $sync.sync();      messenger.success('logged in');   };    $scope.dologin = function() {     mixpanel.track('login');      if (!$scope.loginform.email && !$scope.loginform.password) {       messenger.error('enter email , password tap login');       return;     } else if (!$scope.loginform.email) {       messenger.error('enter email tap login');       return;     } else if (!$scope.loginform.password) {       messenger.error('enter password tap login');       return;     }     ref.authwithpassword({       email    : $scope.loginform.email,       password : $scope.loginform.password     }, afterlogin);        } 

i check user's status this:

check: function() {   var authdata = ref.getauth();   if (authdata) {     mixpanel.identify(authdata.uid);     mixpanel.people.set({       "$email": authdata.password.email     });   }         return !!authdata; } 

it works fine initially, users signed out , have log in again after 12-24 hours of not using app. perhaps when app shunted out of memory? pretty frustrating, not sure what's causing this. session length set 24 weeks, still having problem.

firebase version: 2.1.2 angular: 1.3.6

log of localstorage after authenticating username , password: enter image description here enter image description here

coming day later after being logged out: enter image description here

contents of cookie (same logged in or not, no firebase stuff in there): enter image description here

it's parameter in firebase.

go on dashboard of firebase. click on "login & auth".

then in first paragraph, there input , select session length. can choose how many hours/weekks, etc want.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -