Dear all,
We recently upgraded our platform from Meteor 3.0.4 to the latest 3.2.
We’ve ironed out the few issues related to Express v5 and everything seems to work well except one thing:
We’ve a custom login handler that we use to auto-login users accessing our platform through LTI.
our custom login handler currently returns an object containing “userId” (the id of the user in the DB) and “token” (generated with “Accounts._generateStampedLoginToken()”).
log.info(`${fn}: Logging user ${account._id} in via LTI connection`);
await updateUserByIdAsync(account._id, { $set: { "lti.launch.authorization": "logged-in" } });
// session is valid. confirm login
return {
userId: account._id,
token: Accounts._generateStampedLoginToken()
};
This code doesn’t seem to work reliably now, after the upgrade… when the custom login handler is executed I see the code being called and returning the object but the client doesn’t seem to receive anything back… the state of the client is with the user being “logging in” (that is, I’ve a Meteor.userId() but with Meteor.user() returning undefined). So we’re stuck in this endless waiting game (never receiving any update) until we reload the page (and then we’re logged in).
This is happening only after our update. If we run this code in Meteor 3.0.4 we don’t have any issue.
Have there been any changes in the way custom login handlers are supposed to work (or, more specifically, in the object they have to return upon successful login)?