[SOLVED] Meteor.loginWithWordpress is not a function

Hello.
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:
accounts-base@2.1.0
accounts-password@2.1.0

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