Loading
Current section: Third Party Login 4 exercises
Problem

Sign Up with GitHub and Handling Mocked Data

Loading exercise

Transcript

00:00 So now we're going to do the sign up with GitHub flow. And what's interesting about this sign up is that there's actually nothing different, as far as the code path is concerned, between clicking this button and clicking this button. It's just like aesthetics for the user. But whether you're going through the login with GitHub

00:17 or the sign up with GitHub, it is the same. So the only difference really is, is there already a user signed up or signed in with this particular GitHub account. Other than that, the code flow is going to be exactly the same.

00:33 However, we do need to consider the situation there where there's no existing connection. And that's what you're going to be writing today. So one thing that you need to consider is that because we're mocking everything, we identify our GitHub users by the code that we return from our mock.

00:52 So if I go to my GitHub server provider right here, where we're handling our mock action stuff, here we have our code. And if you want to test this out with somebody and they end up getting signed up, then if you hit sign up with GitHub now, you're logging in again. So you just change this code any time

01:10 you want to change which user you're signing in. And it will create a new user for you every time the mocks will. So that's one thing that you need to be aware of. Another thing you need to be aware of is we've got a special onboarding flow for our providers. It resembles our regular onboarding flow, but it's different enough that it's a separate route.

01:30 So you're going to be, one of the cool things about signing up with a third party service is that they already have some information that you might want to use, like the user's name and maybe the username that they prefer and various other things. And so we're going to have some pre-filled data that you're going to use.

01:49 And so we need to transfer that data from our callback into the onboarding, and we're going to use a key for it or the verify session for that. So you're going to be creating that key there. And then you're also going to need to handle pre-loading that from our loader. And then in our action,

02:09 you're going to be creating a new function in the auth server utility called sign up with connection, and you'll call that here. So you got a couple of places that you're going to be making some changes, and I think that you're going to have a good time doing it. So have a good time. We'll see you when you're done.