Current section: Change Email 4 exercises

Intro to Change Email

Loading lesson


00:00 It's time to change people's emails. People want to be able to change their emails. I think that's a sensible, reasonable thing to do. And we need to verify the user's ownership of their own account and the new email address. So that's what we're going to be doing in this exercise. The idea is you have this change email.

00:17 We want to change it to codyatexample.com. And we go to our inbox and we copy this and paste it. And then we get a little notification that we changed it to codyatexample. But we also send a verification over here saying, hey, your email has been changed.

00:35 If you didn't change it, then here's your account ID. Let us know, and we will look into it. So this one's going to be a little bit different. In the previous verifications, we have had the handle verification function set the verify session cookie and everything and then redirect the user to another page.

00:55 This one's a little different because we don't need any extra information from the user once they've verified that they own the new email. And so what we do is we put the new email address in their verify session cookie. And once they submit that code, we

01:11 know, OK, so they have access to that new email address. So therefore, we can change that email right now. We'll just grab that from the verify session. So it's a little bit different than the ones that we've done before. But still, just as secure and a good workflow for our users.

01:29 So it's going to be a good time. I hope you have fun doing it.