From 6eb2eca8d4bf0febce45d4fd33a4083ddc6fef15 Mon Sep 17 00:00:00 2001 From: Ruben Moor Date: Wed, 13 May 2020 18:26:59 -0500 Subject: [PATCH] deprecated google api replacement --- package-lock.json | 29 ++++++++++++++++++++++------- package.json | 1 + src/auth.js | 2 +- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 82050b8..7d449f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2159,7 +2159,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2574,7 +2575,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2630,6 +2632,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2673,12 +2676,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -4948,6 +4953,16 @@ "requires": { "passport-google-oauth1": "1.x.x", "passport-google-oauth20": "1.x.x" + }, + "dependencies": { + "passport-google-oauth20": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-google-oauth20/-/passport-google-oauth20-1.0.0.tgz", + "integrity": "sha1-O5YOih1w0dvnlGFcgnxoxAOSpdA=", + "requires": { + "passport-oauth2": "1.x.x" + } + } } }, "passport-google-oauth1": { @@ -4959,9 +4974,9 @@ } }, "passport-google-oauth20": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/passport-google-oauth20/-/passport-google-oauth20-1.0.0.tgz", - "integrity": "sha1-O5YOih1w0dvnlGFcgnxoxAOSpdA=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/passport-google-oauth20/-/passport-google-oauth20-2.0.0.tgz", + "integrity": "sha512-KSk6IJ15RoxuGq7D1UKK/8qKhNfzbLeLrG3gkLZ7p4A6DBCcv7xpyQwuXtWdpyR0+E0mwkpjY1VfPOhxQrKzdQ==", "requires": { "passport-oauth2": "1.x.x" } diff --git a/package.json b/package.json index d7de010..0ee5523 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "passport-facebook": "^2.1.1", "passport-github2": "^0.1.11", "passport-google-oauth": "^1.0.0", + "passport-google-oauth20": "^2.0.0", "passport-mastodon": "^0.1.3", "passport-twitter": "^1.0.4", "pushover-notifications": "^0.2.4", diff --git a/src/auth.js b/src/auth.js index 5ba5c22..b72ba95 100644 --- a/src/auth.js +++ b/src/auth.js @@ -3,7 +3,7 @@ const session = require('express-session'); const SQLiteStore = require('connect-sqlite3')(session); const TwitterStrategy = require('passport-twitter').Strategy; const GitHubStrategy = require('passport-github2').Strategy; -const GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; +const GoogleStrategy = require('passport-google-oauth20'); const FacebookStrategy = require('passport-facebook').Strategy; const MastodonStrategy = require('passport-mastodon').Strategy; const fetch = require('node-fetch');