Being relatively new to JavaScript, I am trying to implement Amazon login in Node.js + Express / Angular.js app.
Here is the piece from Node.js Passport authentication middleware example:
app.get('/auth/facebook/callback',
passport.authenticate('service', { session: false }),
function(req, res) {
// Successful authentication, redirect home.
// I have access to web token here
res.redirect('/');
});
The question is how do I modify the code above to pass web token that I obtain in function(req, res)
in Node.js backend to AngularJS frontend assuming my AngularJS app is hosted at http://example.com while after logging in with Amazon, the app gets redirected to http://example.com/auth/facebook/callback URL.