Day 3

More work on phone number sign up today. Still figuring out how to store and confirm phone numbers. To give a little more information on the process, here are the fields I‘m working with to sign someone up via a phone number:

phone number: 10 digits
confirmed: true/false
confirmation token: a bunch of random characters like ehjsij274jdh38

This is what you need if you are storing phone numbers in their own table. When you need a phone number for someone, you just look for the one where confirmed = true. You can ignore the other ones.

If you’re storing the phone number alongside other data, say in your user table, you need something like this:

phone number: 10 digits
new phone number: 10 digits
confirmation token: a bunch of random characters like ehjsij274jdh38

You need two phone number fields when someone changes their number. That way you can keep track of the old number while the new number is being confirmed.

I like the first approach because it seems cleaner and allows for more checks to be passed off to the database. You can require the phone number field to always be populated with the first approach, but not the second.

But I’m running into a few issues getting it to work. It might be a dumb idea and a waste of time. Hoping to get it wrapped up either way tomorrow and keep moving on other features.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.