liaujianjie / firebase-to-supabase-auth-migrator

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

Support phone authentication #3

Open mtwichel opened 3 years ago

mtwichel commented 3 years ago

Hi there 👋 I love that this package exists and thank you for making it!

I was curious if we could make this package handle users with phone-based authentication now that Supabase supports it. It seems like it won't work in it's current form per the README:

The scripts requires that your Firebase Auth users must have an email.

I'm very new to Supabase so I don't know if it's even possible to migrate those phone auth users; but, if it is, could we update the package to support it? If we had an outlined approach I'm happy to submit a PR for it, I just have no direction on how to make it work.

Thanks!

liaujianjie commented 3 years ago

I'm not sure how phone auth works on both platforms but I'm more than happy to kick start a discussion on how support for phone can be added.

Is it true that a Supabase Auth user must either have at least an email or a phone number? If so, then it's as simple as:

  1. Modifying the types to be of union type having either email or phone number, and
  2. Updating the type guard to check for this correctly. Then,
  3. Updating the column set and inserted row values to support phone numbers.
mtwichel commented 3 years ago

Is it true that a Supabase Auth user must either have at least an email or a phone number?

I'm not sure but I bet I can find out - I'll ask in the Discord :)