mozilla/browserid — pull request #2529 by yourcelf (2012-09-26 18:13:10+00:00)
Title: Allow navigator.id.logout() before session loads

Prior to this patch, ``navigator.id.logout`` no-ops if it is called
before a session has loaded (e.g., before the query to login.persona.org
returns, and before "onlogin" has fired).

This patch changes the behavior of ``logout`` by having it set a flag
which prevents "onlogin" from firing again until the next time
``navigator.id.request`` is called.

The assumption is that the intention behind a call to
``navigator.id.logout`` is to clear any session, whether it's locally
cached or not; and that this intention should be honored until a new
session is requested through ``navigator.id.request``.

Discussion of the rationale is present in issues #2521, #2520, and the
following mailing list thread:

https://groups.google.com/forum/?fromgroups=#!topic/mozilla.dev.identity/mDj8oLKn8aI