From the course: React: Authentication

Unlock this course with a free trial

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

Adding an OAuth URL route

Adding an OAuth URL route - React.js Tutorial

From the course: React: Authentication

Adding an OAuth URL route

- [Instructor] All right, so now that we've set up Oauth in Google Cloud, the next thing that we're going to do is create a route whose purpose will be to give us the URL that the user should be redirected to when they click the Login with Google button. This might not make sense quite yet, but just bear with me here. It's pretty straightforward. All right, so to get started here, we're going to create a new file and this is going to be sort of like a utility file that will contain functions that will make it easier to create this route that we're talking about. So we're going to call this something like googleOauthutil.js, and inside here what we're going to do is we're going to start off by importing, by saying const { google } = require('googleapis') and we will have to install this into our project, so let's actually do that. And once again, if you're using Codespaces and the code space has shut down recently and you don't have the front and backend running, what we're going to…

Contents