From the course: Node: Authentication

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Extend the application for single sign-on

Extend the application for single sign-on

From the course: Node: Authentication

Extend the application for single sign-on

- [Instructor] In our last step, we now have to implement a rather interesting flow. We also need to extend the database a bit to support storing the profile ID. The main challenge is that GitHub supports multiple email addresses and that for us, the email address is a mandatory field. So if we get the profile with two email addresses, which one should we take? So it's better to provide a way for the user to complete their profile with a valid email address. And while I'm at it, I also want to let them set their username. So I want them to be able to log in using GitHub but I don't want to force them to use a given username or use an arbitrary email address that might not be the one that they want to use. So let's kick this off by extending the database to support arbitrary social profiles. For that, I open server, models, UserModel and there somewhere down there after the verification token, I now add a structure…

Contents