Current section: OAuth 6 exercises

Updating Prisma Schema for GitHub Login

Loading exercise


00:00 For us to be able to log in with GitHub, we need to have a user that has a connection already. And we also need to have some data or tables in the database for managing these connections. So your job in this exercise is to update the Prisma schema to add a connection model.

00:17 The most important part of that is the provider name and the provider ID that will uniquely identify a connection or like an account on another service. And then it will be associated to the user in a many-to-one relationship, or one-to-many. So one user can have multiple connections.

00:35 One connection can only belong to one user. And then on top of that, we also like, so there are like index and unique implications there. So just a little tip there. And then we're gonna update our seed script so that Cody has a connection to a GitHub account already so that when you click login with GitHub,

00:55 it can log in as Cody. So you can test out that as well. Of course, that's not gonna happen at the end of this exercise because we still need to implement what happens when we have a successful connection with GitHub, but that we'll get to soon. So for this exercise, yeah, you're just updating the Prisma schema

01:14 and you're going to update the seed script so that we insert a GitHub user and associate that GitHub user with Cody. So have a good time with that. We'll see you when you're done.