zeroasterisk
zeroasterisk

Reputation: 2209

Meteor Accounts Resume Token "Remember Me"

I'm building a Meteor + Cordova app where I want sign-in to "stick forever" on the mobile device.

I see the following tutorial whereby I can setup my own custom "resume handler"

I'll probably write my own (janky) implementation of the above functions and try to get it working, probably storing in localStorage on the client... but I thought I'd ask here to see if anyone knew of a specific solution to this wrapped as package, or a clean example.

Ideally:

NOTE: this is related to Meteor Accounts autologin pattern?

Recommendations?

Upvotes: 6

Views: 4749

Answers (2)

Mart
Mart

Reputation: 31

This mbanting:cordova-accounts-resume package will help resolve this by saving the loginToken on the file system, to be used if localStorage is cleared out before the app resumes.

Upvotes: 3

Green
Green

Reputation: 5000

How about using the built-in Accounts.config(options) http://docs.meteor.com/#accounts_config

Accounts.config({
   loginExpirationInDays: null
}) 

Once logged in, it will never expire until the user logout again with Meteor.logout();

However, be aware that since the token is stored in localstorage, it get cleaned sometimes automatically by iOS or android

Upvotes: 4

Related Questions