Check if user has used another provider firebase

I have an app which has only used Google for signing in. To associate a user to the data in my database I made the mistake to use the Google account ID and not the firebaseuser id.

Now I am forced to use Apple sign in and if a user already has an account from signing in with Google, the data might be lost because I cannot associate the user to the data.

Any good ideas for handling this?