Skip to content

brettle/meteor-workaround-issue-4862

Repository files navigation

brettle:workaround-issue-4862

Build Status

Workaround Meteor issue #4862 so that Meteor.user() and Meteor.userId() work in callbacks registered with Accounts.onLogin() and Accounts.onLoginFailure() on the server.

Installation

meteor add brettle:workaround-issue-4862

Usage

Just install it and it should work.

How it Works

It monkey patches Accounts.onLogin() and Accounts.onLoginFailure() so that during registration Meteor.bindEnvironment() is monkey patched to not bind the registering environment to the callback. This ensures that callback will run in the environment of the login method invocation.

About

Workaround Meteor issue 4862 - user/userId broken in server onLogin

Resources

License

Stars

Watchers

Forks

Packages

No packages published