How to make switching between accounts, as in yandex, mail, gmail?

Hi to all, how is switching between accounts yandex, mail, gmail?
Do I understand correctly that on frontend, they are just stored in localStorage some data?
And how it behaves in this case the server? or server something also need?
April 3rd 20 at 18:48
1 answer
April 3rd 20 at 18:50
In the case of oauth2 tokens are stored (not necessarily in local storage, for older browsers and cookies) for several accounts. When you switch accounts, select which token to write in the header of the requests. The server determines the user token data.

Find more questions by tags Web Development