[Solved] Async server login handler

We are migrating to 2.10 and I was curious what the guidance was for server login handlers.
In my initial testing, passing in an async function does not work, and I still need to call
return Meteor.wrapAsync([my async worker function])

Is there going to be a registerLoginHandlerAsync in the future or how is this going to be implemented?

Thanks!
Mark

I think version 2.10 registerLoginHandler supports async function: meteor/accounts_server.js at release-2.10 · meteor/meteor · GitHub

I see what you mean, it does look like it. In my initial tests, this did not work, however I will test it again.
Thanks!

The d.ts file might be out of date. The compiler warns me that the return signature must get a LoginMethodResult, and does not like an async function (where the return type is Promise)

However, the code does seems to work.

1 Like