Using meteor, I’d like to be able to augment a user record after they’ve logged in (authenticated) with an external service to get their authorization claims.
Update
I am using the {{loginButtons}} handlebars helper widget.
Currently, I see an Accounts.validateNewUser and an Accounts.onCreateUser that can be hooked into during the creation of a new user. These would be helpful initially, but my need is recurrent.
I understand that there is the allow function that hangs off the Meteor.Collection as a means of authorizing a user’s access to the collection — which is precisely where I would use the claims that I intend to augment the user with to determine authorization.
Does anyone know of a hook during the login process that would allow me to do this?
The easiest way to get around the lack of a callback is to use the relevant reactive variable:
The context setup by
autorunwill only re-run when the value ofMeteor.userId()changes — i.e. when they login.