[SOLVED] Meteor.loginWithWordpress is not a function

I am using Meteor accounts wordpress to authenticate users via Wordpress.

After updating to 2.4 (was stuck at 1.8.3 for a while), I cloned the package to /packages and changed “api.versionsFrom(‘METEOR@0.9.4’)” to api.versionsFrom([‘1.0.3’, ‘2.3’]) as advised.

However, when calling Meteor.loginWithWordpress from the client, I get “Uncaught TypeError: Meteor.loginWithWordpress is not a function”.
On the same time, calling the above function from the console works!

Package versions:

Any suggestions?
Thanks in advance.

I solved it!
I knew the meteor-accounts-wordpress package was rather old.

After examining the code of accounts-weibo, I added the following to wordpress.js:

Accounts.registerClientLoginFunction('wordpress', loginWithWordPress);
Meteor.loginWithWordpress = (...args) => 
   Accounts.applyLoginFunction('wordpress', args);

and worked like a charm!

1 Like