ddp-login
ddp-login copied to clipboard
Logout
Thank you for this awesome package! Is it possible to do a logout as well?
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.