Email or username:

Password:

Forgot your password?
dansup

Account switching is a tricky feature to implement properly because it involves a carefully orchestrated procedure that involves rotating cached auth data, invalidating the api query cache and then storing new auth data and applying the per-account settings.

There are a ton of things to watch out for, like expired auth tokens, and the refresh logic, deleted accounts, and 2FA.

Not to mention Push Notifications, its possible you'll get notifications from other accounts and we have to handle that

1 comment
Peter Toft Jølving

@dansup yeah, multi-tenancy can be a pain to retrofit. If you know ahead of time, that you want it, you can scope the data stores to individual users.
One way to deal with it (if you want suggestions, otherwise sorry!) is to use a global singleton for storing active user ID and a factory that returns indivual data stores for each user ID and use that when injecting the data stores and changing the active account. Would that be feasible in your situation?

Go Up