Remember me meteorite token

I am creating a Meteor + Cordova application where I want to sign in on my mobile device forever.

I see the following tutorial in which I can set up my own “resume handler”

I will probably write my own (janky) implementation of the above functions and try to get it to work, possibly stored in localStorage on the client ... but I thought I would ask here to see if anyone knows about a specific solution for this package in as a package or a pure example.

Perfectly:

  • meteor add xxxxx:rememberme
  • Customization
    • rememberMe.config.days = 9999
    • rememberMe.config.storageClient = localStorage

NOTE: is this related to the Meteor Accounts auto-login template?

Recommendations

+6
source share
2 answers

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

 Accounts.config({ loginExpirationInDays: null }) 

After logging in, it will never expire until the user logs out again using Meteor.logout ();

However, keep in mind that since the token is stored in localstorage, it is sometimes cleared by iOS or Android

+4
source

This mbanting: cordova-accounts-resume package will help solve this problem by storing the loginToken on the file system, which will be used if localStorage is cleared before the application resumes.

+3
source

Source: https://habr.com/ru/post/975165/


All Articles