liaujianjie / firebase-to-supabase-auth-migrator

Collection of scripts to migrate from Firebase Auth users to Supabase Auth
MIT License
22 stars 4 forks source link

Fix import script for email signins #2

Closed imagitama closed 3 years ago

imagitama commented 3 years ago

Issue

The import script (scripts/import-supabase-auth.ts) is completely broken because when it tries to validate the auth export it checks the JSON string not the parsed JSON.

Also there are instances where the user does not have any provider info (eg. when signed up by email).

Solution

Pass the correct variable to the validator.

Check if provider info exists before using the data inside of it.

Other changes

Dumped the error to the console because it is super helpful for the dev.

Testing