How to migrate users from Strapi to Firebase?

Viewed 641

When I'm trying to import users with a local account everything is good, but whenever I need to import the users with a Facebook Provider I'm missing the providerData.uid from Strapi. I don't think it's stored anywhere in the database.

const userImportRecords = [
    {
        uid: '333333333',
        email: 'myfacebookemail@gmail.com',
        providerData: [{
          uid: 0, // I don't have the facebook user id
          email: 'myfacebookemail@gmail.com',
          providerId: 'facebook.com'
        }]
    }
];

admin.auth().importUsers(userImportRecords, {
  hash: {
    algorithm: 'BCRYPT',
    rounds: 10
  }
})

The user is added to the firebase authentification as a Facebook provider, but whenever I sign-in with Facebook with signInWithRedirect(new firebase.auth.FacebookAuthProvider()) it log me out automatically.

I'm looking for a solution when I don't have the providerData.uid of a user. Both share the same fb app

Thank you

0 Answers
Related