dalenguyen / firebase-wordpress-plugin

A plugin that helps to integrate Firebase to WordPress
https://firebase-wordpress-docs.readthedocs.io
GNU General Public License v2.0
110 stars 31 forks source link

Firebase Accounts aren't automatically synced to Wordpress #180

Closed ciriousjoker closed 2 years ago

ciriousjoker commented 2 years ago

Is your feature request related to a problem? Please describe. We have a mobile app (Flutter) and a website (Wordpress).

Describe the solution you'd like

Describe alternatives you've considered

Which fields does it relate to? Firebase Auth

dalenguyen commented 2 years ago

Hi @CiriousJoker, which version of the plugin are you using?

And do you have a link for the website that I can have a look at?

ciriousjoker commented 2 years ago

@dalenguyen

v2.18 (afaik newest at time of writing).

I sent you an email with the url and a couple of logins. I'm afraid I can't share such info on a public git issue.

dalenguyen commented 2 years ago

Moved to email support.

ciriousjoker commented 2 years ago

It's working now.

The issue was an incompatibility between JWT Auth & Integrate Firebase PRO. This was fixed by whitelisting the necessary endpoint in JWT Auth.

In my case I had to move the filter code into its own plugin as suggested by the JWT Auth readme:

Code

/**
 * Fix compatibility between JWT Auth & Integrate Firebase PRO
 * Related Links:
 * - https://wordpress.org/plugins/jwt-auth/
 * - https://firebase.dalenguyen.me/
 * - https://github.com/dalenguyen/firebase-wordpress-plugin/issues/180
 * - https://github.com/usefulteam/jwt-auth/issues/41
 */
add_filter( 'jwt_auth_whitelist', function ( $endpoints ) {
  $your_endpoints = array(
      '/wp-json/firebase/v2/*',
  );
  return array_unique( array_merge( $endpoints, $your_endpoints ) );
});
dalenguyen commented 2 years ago

@CiriousJoker Awesome. I'm glad that it works!