Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 26, 2019. It is now read-only.

Commit df901b5

Browse files
committed
Discard google account name.
1 parent b5186c7 commit df901b5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/passport.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@ export default function configurePassport(uw, options) {
3232
}, callbackify(localLogin)));
3333

3434
if (options.auth && options.auth.google) {
35+
async function googleLogin(accessToken, refreshToken, profile) {
36+
return socialLogin(accessToken, refreshToken, {
37+
id: profile.id,
38+
photos: profile.photos
39+
});
40+
}
41+
3542
passport.use('google', new GoogleStrategy({
3643
callbackURL: '/auth/service/google/callback',
3744
...options.auth.google,
3845
scope: ['profile'],
39-
}, callbackify(socialLogin)));
46+
}, callbackify(googleLogin)));
4047
}
4148

4249
passport.use('jwt', new JWTStrategy(options.secret, user => uw.getUser(user.id)));

0 commit comments

Comments
 (0)