From the course: React: Authentication
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Adding an OAuth URL route - React.js Tutorial
From the course: React: Authentication
Adding an OAuth URL route
- [Instructor] All right. Now that we've set up a project in Google, we're free to start implementing Google OAuth into our app. Now, as we learned, the first step in the OAuth flow is to have Google generate a special URL for us to send the user to so that they can tell Google if it's okay for us to access their data. So the first thing we're going to do here is create a route on our server that will generate this URL and send it back to our client. So here's what that's going to look like. We're going to open up routes and create a new file here which we'll call get Google OAuth URL route, kind of a cumbersome name, but it'll work. And we could just put all of the logic for generating this URL directly into the route itself, but what we're actually going to do before we code out this route is create a utility function. So inside Util we'll create a new file and we're going to call this file, Get Google Oauth URL.JS. So…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
OAuth basics3m 17s
-
(Locked)
Setting up OAuth on Google6m 33s
-
(Locked)
Adding an OAuth URL route7m 49s
-
(Locked)
Creating a "Sign in with Google" button4m 49s
-
(Locked)
Loading user info from Google5m 32s
-
(Locked)
Creating new users from OAuth data4m 32s
-
(Locked)
Adding an OAuth callback route4m 26s
-
(Locked)
Handling successful OAuth authentication3m 40s
-
(Locked)
-
-
-