Add Accounts.onLogout(func) Hook #6889
Conversation
Test failed in livedata package. Could someone help me discover the issue on this please? Only did work in Failed Test:
EDIT It seems that checking out commit 7012957a still has the same failing test. My guess is that this issue is not related and outside the scope of this PR. |
This feature is very important. Thank you for working on this, hopefully this onLogout hook will be available soon. |
Can you rebase this to be off of current
Also, note that the docs have moved to https://github.com/meteor/docs. Sorry this PR got caught up in that change, so for now just remove the docs changes from the PR and we'll open a PR there once this commit is in. |
add this!! |
This would be great |
@@ -88,6 +96,14 @@ Accounts.onLoginFailure(function (attempt) { | |||
} | |||
}); | |||
|
|||
var capturedLogouts = {}; |
benjamn
Jun 7, 2016
Member
Shouldn't this be an array ([]
)?
Shouldn't this be an array ([]
)?
Seems to be a major asymmetry here. The relevant connection id has to be scrounged up with At the very least, the userId of the user logging out, and current connection should be provided.... |
@convexset #7433 should be released in 1.4.1 soon. |
is onLogout available ? |
Accounts.onLogout(func)
is practically identical to the implementation ofAccounts.onLogin(func)
. This PR is an effort to maintain symmetry between the available Login / Logout hooks.Use cases include destroying active session variables, reverting UI elements, and any other cleanup that needs to occur immediately after the user is logged out.
This PR is related to the following discussions:
#5984
#3867
#1074
#426
Corresponding user-facing documentation has also been provided in this PR, as well as appropriate tests.