Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain how to get email so we can finally fix this bug of 7 years - … #191

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ passport.use(new OAuth2Strategy({
tokenURL: 'https://www.example.com/oauth2/token',
clientID: EXAMPLE_CLIENT_ID,
clientSecret: EXAMPLE_CLIENT_SECRET,
callbackURL: "http://localhost:3000/auth/example/callback"
callbackURL: "http://localhost:3000/auth/example/callback",
scope: "openid email profile offline_access",
},
function(accessToken, refreshToken, profile, cb) {
function(accessToken, refreshToken, params, profile, cb) {
const token = jwt_decode(accessToken);
const email = jwt_decode(params.id_token).email;
const user = { ...token, email };
User.findOrCreate({ exampleId: profile.id }, function (err, user) {
return cb(err, user);
});
Expand Down