ddp-login icon indicating copy to clipboard operation
ddp-login copied to clipboard

Logout

Open maxnowack opened this issue 8 years ago • 1 comments

Thank you for this awesome package! Is it possible to do a logout as well?

maxnowack avatar May 26 '16 11:05 maxnowack

That is a very good question!

To my knowledge there is no explicit way to logout. The way the DDP protocol works is that you must authenticate with each new TCP connection. Connections drop all the time, and so transparent re-authentication is implemented by caching the authentication token and using it again.

So "logging out" is really nothing more than erasing all local copies of the authentication token and then dropping the connection. Done.

If your intent is to destroy the authentication token on the server so it can never be used again, that is a server-side MongoDB operation that I don't believe has standard method implementation, but it is easy enough to implement yourself.

vsivsi avatar May 26 '16 17:05 vsivsi