mondora / asteroid

An alternative client for a Meteor backend
MIT License
734 stars 101 forks source link

Communicate login information #42

Closed bernatfortet closed 9 years ago

bernatfortet commented 9 years ago

Hi,

I have a chrome extension that uses Twitter Sign in. Also, I have a Meteor client that uses Twitter Sign in.

How can I sign in once and affect the other?

eg. I login on the meteor client and now the chrome extension is also logged.

Thank you.

pscanf commented 9 years ago

Hello Bernat :-),

It should be possible, theoretically, but Asteroid doesn't offer the functionality (yet :-) ).

Upon login, meteor stores your login information in localStorage with the following keys:

A similar thing is done by Asteroid, which stores the login token in multiStorage, an abstraction over the various implementations of localStorage available for different platforms (in the chrome extensions platform it uses chrome.storage.local):

If you keep the two "storages" in sync, once you login somewhere, you're logged in everywhere. The "theoretically possible" refers to keeping the two storages in sync. I suppose you could do something like:

Let me know how it goes. :-)

Cheers

bernatfortet commented 9 years ago

Thanks!