Skip to content

Commit 136f15e

Browse files
committed
fix(oauth): Google scopes deprecated
The following scopes are no longer supported: - https://www.googleapis.com/auth/userinfo.profile - https://www.googleapis.com/auth/userinfo.email Use the following in place - profile - email Passport also does not provide the username, but we can get it from the email.
1 parent f6e7a12 commit 136f15e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/templates/server/auth(auth)/google(googleAuth)/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ router
1010
.get('/', passport.authenticate('google', {
1111
failureRedirect: '/signup',
1212
scope: [
13-
'https://www.googleapis.com/auth/userinfo.profile',
14-
'https://www.googleapis.com/auth/userinfo.email'
13+
'profile',
14+
'email'
1515
],
1616
session: false
1717
}))

app/templates/server/auth(auth)/google(googleAuth)/passport.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ exports.setup = function(User, config) {
1919
name: profile.displayName,
2020
email: profile.emails[0].value,
2121
role: 'user',
22-
username: profile.username,
22+
username: profile.emails[0].value.split('@')[0],
2323
provider: 'google',
2424
google: profile._json
2525
});

0 commit comments

Comments
 (0)