Full-Stack Web Development with Vue.js and Node

(singke) #1
Building OAuth Strategies with passport.js Chapter 7

app.get('/login/twitter/return',
passport.authenticate('twitter', { failureRedirect: '/login' }),
(req, res) => {
res.redirect('/');
});
};

We have to consider a few things here. Twitter does not allow us to access the user's email
address by default. For that, we will need to check a field called Request email addresses


from users while setting up the Twitter application, which can be found under
the Permissions tab.


Before we do that, we also need to set the Privacy Policy URL and Terms of Service URL


in order to request the user's access to their email address. This setting can be found under
the Settings tab:

Free download pdf