Skip to content

Commit 4ab8d10

Browse files
committed
#195 userProfileURL for book apps
1 parent e58bff5 commit 4ab8d10

File tree

33 files changed

+44
-286
lines changed

33 files changed

+44
-286
lines changed

book/3-end/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
},
1111
"dependencies": {
1212
"@material-ui/core": "3.9.1",
13-
"@passport-next/passport-google-oauth2": "^1.0.0",
1413
"connect-mongo": "2.0.1",
1514
"dotenv": "6.1.0",
1615
"express": "4.16.4",

book/3-end/server/google.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const passport = require('passport');
2-
// const Strategy = require('passport-google-oauth').OAuth2Strategy;
3-
const GoogleStrategy = require('@passport-next/passport-google-oauth2').Strategy;
2+
const Strategy = require('passport-google-oauth').OAuth2Strategy;
43
const User = require('./models/User');
54

65
function auth({ ROOT_URL, server }) {
@@ -31,11 +30,12 @@ function auth({ ROOT_URL, server }) {
3130
}
3231
};
3332
passport.use(
34-
new GoogleStrategy(
33+
new Strategy(
3534
{
3635
clientID: process.env.Google_clientID,
3736
clientSecret: process.env.Google_clientSecret,
3837
callbackURL: `${ROOT_URL}/oauth2callback`,
38+
userProfileURL: 'https://www.googleapis.com/oauth2/v3/userinfo',
3939
},
4040
verify,
4141
),

book/3-end/yarn.lock

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -774,27 +774,6 @@
774774
prop-types "^15.6.0"
775775
react-is "^16.6.3"
776776

777-
"@passport-next/passport-google-oauth2@^1.0.0":
778-
version "1.0.0"
779-
resolved "https://registry.yarnpkg.com/@passport-next/passport-google-oauth2/-/passport-google-oauth2-1.0.0.tgz#cadef72d9ef42d549a5578eab338febdf234f806"
780-
integrity sha512-rbAtK0eGgjQhT/MqMSuN7Mxy4XTr1/LINk5rYPVezP3MfkVYuK20V0XW9fg1ikFMvyxSdmfLTyYduud7SfFSqw==
781-
dependencies:
782-
"@passport-next/passport-oauth2" "1.7.x"
783-
784-
"@passport-next/[email protected]":
785-
version "1.7.0"
786-
resolved "https://registry.yarnpkg.com/@passport-next/passport-oauth2/-/passport-oauth2-1.7.0.tgz#48ef05df2a7980e888350a824e706ec177a40d93"
787-
integrity sha512-0905TcHFwvqPyMsqTKDwjwddPJJcWkUs4fjbUNgnnxkfQ0/LX4FVwuMywOXiFNY12hhX92j8F5srGQC4f9UWug==
788-
dependencies:
789-
"@passport-next/passport-strategy" "1.1.x"
790-
lodash ">=4.17.5"
791-
oauth "0.9.x"
792-
793-
"@passport-next/[email protected]":
794-
version "1.1.0"
795-
resolved "https://registry.yarnpkg.com/@passport-next/passport-strategy/-/passport-strategy-1.1.0.tgz#4c0df069e2ec9262791b9ef1e23320c1d73bdb74"
796-
integrity sha512-2KhFjtPueJG6xVj2HnqXt9BlANOfYCVLyu+pXYjPGBDT8yk+vQwc/6tsceIj+mayKcoxMau2JimggXRPHgoc8w==
797-
798777
"@types/jss@^9.5.6":
799778
version "9.5.7"
800779
resolved "https://registry.yarnpkg.com/@types/jss/-/jss-9.5.7.tgz#fa57a6d0b38a3abef8a425e3eb6a53495cb9d5a0"
@@ -3989,7 +3968,7 @@ [email protected]:
39893968
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
39903969
integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=
39913970

3992-
[email protected], lodash@>=4.17.5, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5:
3971+
[email protected], lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5:
39933972
version "4.17.11"
39943973
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
39953974
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==

book/4-end/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
},
1515
"dependencies": {
1616
"@material-ui/core": "3.9.1",
17-
"@passport-next/passport-google-oauth2": "^1.0.0",
1817
"aws-sdk": "2.342.0",
1918
"connect-mongo": "2.0.1",
2019
"dotenv": "6.1.0",

book/4-end/server/google.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const passport = require('passport');
2-
// const Strategy = require('passport-google-oauth').OAuth2Strategy;
3-
const GoogleStrategy = require('@passport-next/passport-google-oauth2').Strategy;
2+
const Strategy = require('passport-google-oauth').OAuth2Strategy;
43
const User = require('./models/User');
54

65
function auth({ ROOT_URL, server }) {
@@ -31,11 +30,12 @@ function auth({ ROOT_URL, server }) {
3130
}
3231
};
3332
passport.use(
34-
new GoogleStrategy(
33+
new Strategy(
3534
{
3635
clientID: process.env.Google_clientID,
3736
clientSecret: process.env.Google_clientSecret,
3837
callbackURL: `${ROOT_URL}/oauth2callback`,
38+
userProfileURL: 'https://www.googleapis.com/oauth2/v3/userinfo',
3939
},
4040
verify,
4141
),

book/4-end/yarn.lock

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -774,27 +774,6 @@
774774
prop-types "^15.6.0"
775775
react-is "^16.6.3"
776776

777-
"@passport-next/passport-google-oauth2@^1.0.0":
778-
version "1.0.0"
779-
resolved "https://registry.yarnpkg.com/@passport-next/passport-google-oauth2/-/passport-google-oauth2-1.0.0.tgz#cadef72d9ef42d549a5578eab338febdf234f806"
780-
integrity sha512-rbAtK0eGgjQhT/MqMSuN7Mxy4XTr1/LINk5rYPVezP3MfkVYuK20V0XW9fg1ikFMvyxSdmfLTyYduud7SfFSqw==
781-
dependencies:
782-
"@passport-next/passport-oauth2" "1.7.x"
783-
784-
"@passport-next/[email protected]":
785-
version "1.7.0"
786-
resolved "https://registry.yarnpkg.com/@passport-next/passport-oauth2/-/passport-oauth2-1.7.0.tgz#48ef05df2a7980e888350a824e706ec177a40d93"
787-
integrity sha512-0905TcHFwvqPyMsqTKDwjwddPJJcWkUs4fjbUNgnnxkfQ0/LX4FVwuMywOXiFNY12hhX92j8F5srGQC4f9UWug==
788-
dependencies:
789-
"@passport-next/passport-strategy" "1.1.x"
790-
lodash ">=4.17.5"
791-
oauth "0.9.x"
792-
793-
"@passport-next/[email protected]":
794-
version "1.1.0"
795-
resolved "https://registry.yarnpkg.com/@passport-next/passport-strategy/-/passport-strategy-1.1.0.tgz#4c0df069e2ec9262791b9ef1e23320c1d73bdb74"
796-
integrity sha512-2KhFjtPueJG6xVj2HnqXt9BlANOfYCVLyu+pXYjPGBDT8yk+vQwc/6tsceIj+mayKcoxMau2JimggXRPHgoc8w==
797-
798777
"@types/jss@^9.5.6":
799778
version "9.5.7"
800779
resolved "https://registry.yarnpkg.com/@types/jss/-/jss-9.5.7.tgz#fa57a6d0b38a3abef8a425e3eb6a53495cb9d5a0"
@@ -5278,7 +5257,7 @@ lodash.sortby@^4.7.0:
52785257
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
52795258
integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=
52805259

5281-
[email protected], lodash@>=4.17.5, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5:
5260+
[email protected], lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5:
52825261
version "4.17.11"
52835262
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
52845263
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==

book/4-start/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
},
1111
"dependencies": {
1212
"@material-ui/core": "3.9.1",
13-
"@passport-next/passport-google-oauth2": "^1.0.0",
1413
"aws-sdk": "2.342.0",
1514
"connect-mongo": "2.0.1",
1615
"dotenv": "6.1.0",

book/4-start/server/google.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const passport = require('passport');
2-
// const Strategy = require('passport-google-oauth').OAuth2Strategy;
3-
const GoogleStrategy = require('@passport-next/passport-google-oauth2').Strategy;
2+
const Strategy = require('passport-google-oauth').OAuth2Strategy;
43
const User = require('./models/User');
54

65
function auth({ ROOT_URL, server }) {
@@ -31,11 +30,12 @@ function auth({ ROOT_URL, server }) {
3130
}
3231
};
3332
passport.use(
34-
new GoogleStrategy(
33+
new Strategy(
3534
{
3635
clientID: process.env.Google_clientID,
3736
clientSecret: process.env.Google_clientSecret,
3837
callbackURL: `${ROOT_URL}/oauth2callback`,
38+
userProfileURL: 'https://www.googleapis.com/oauth2/v3/userinfo',
3939
},
4040
verify,
4141
),

book/4-start/yarn.lock

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -774,27 +774,6 @@
774774
prop-types "^15.6.0"
775775
react-is "^16.6.3"
776776

777-
"@passport-next/passport-google-oauth2@^1.0.0":
778-
version "1.0.0"
779-
resolved "https://registry.yarnpkg.com/@passport-next/passport-google-oauth2/-/passport-google-oauth2-1.0.0.tgz#cadef72d9ef42d549a5578eab338febdf234f806"
780-
integrity sha512-rbAtK0eGgjQhT/MqMSuN7Mxy4XTr1/LINk5rYPVezP3MfkVYuK20V0XW9fg1ikFMvyxSdmfLTyYduud7SfFSqw==
781-
dependencies:
782-
"@passport-next/passport-oauth2" "1.7.x"
783-
784-
"@passport-next/[email protected]":
785-
version "1.7.0"
786-
resolved "https://registry.yarnpkg.com/@passport-next/passport-oauth2/-/passport-oauth2-1.7.0.tgz#48ef05df2a7980e888350a824e706ec177a40d93"
787-
integrity sha512-0905TcHFwvqPyMsqTKDwjwddPJJcWkUs4fjbUNgnnxkfQ0/LX4FVwuMywOXiFNY12hhX92j8F5srGQC4f9UWug==
788-
dependencies:
789-
"@passport-next/passport-strategy" "1.1.x"
790-
lodash ">=4.17.5"
791-
oauth "0.9.x"
792-
793-
"@passport-next/[email protected]":
794-
version "1.1.0"
795-
resolved "https://registry.yarnpkg.com/@passport-next/passport-strategy/-/passport-strategy-1.1.0.tgz#4c0df069e2ec9262791b9ef1e23320c1d73bdb74"
796-
integrity sha512-2KhFjtPueJG6xVj2HnqXt9BlANOfYCVLyu+pXYjPGBDT8yk+vQwc/6tsceIj+mayKcoxMau2JimggXRPHgoc8w==
797-
798777
"@types/jss@^9.5.6":
799778
version "9.5.7"
800779
resolved "https://registry.yarnpkg.com/@types/jss/-/jss-9.5.7.tgz#fa57a6d0b38a3abef8a425e3eb6a53495cb9d5a0"
@@ -5278,7 +5257,7 @@ lodash.sortby@^4.7.0:
52785257
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
52795258
integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=
52805259

5281-
[email protected], lodash@>=4.17.5, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5:
5260+
[email protected], lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5:
52825261
version "4.17.11"
52835262
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
52845263
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==

book/5-end/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
},
1515
"dependencies": {
1616
"@material-ui/core": "3.9.1",
17-
"@passport-next/passport-google-oauth2": "^1.0.0",
1817
"aws-sdk": "2.342.0",
1918
"connect-mongo": "2.0.1",
2019
"dotenv": "6.1.0",

0 commit comments

Comments
 (0)