Udemy_Fullstack_React - MaxGolden/Personal_Blogs GitHub Wiki

Google OAuth

[1] passport.JS install

install --save passport passport-google-oauth20

[2] setup passport-1

const express = require("express");
const passport = require("passport");
const GoogleStrategy = require("passport-google-oauth20").Strategy;

const app = express();

passport.use(new GoogleStrategy());

WARNING

Fixing redirect URI wildcard issue
// Version ERROR!!!
// 1. Leave the authorized URI Redirect blank, since we will be fixing this later.
// 2. Enter http://localhost:5000/auth/google/callback now, since that is what it will be changed to in a later lecture.
// 3. Disable the Google+ API
// 4. Add new line until it fixed: `userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo"`

[3]githu