title: Return view and send data to react after passport.js oauth
body: <p>First let me say that sorry if this is a simple question, I'm new to react and express and couldn't find the answer on SO.</p>
  
  <p>I'm trying to pass data to a react object as well as render a view based off of a passport.js return route.</p>
  
  <p>I have the object i need to pass I just can't figure out how to pass it.</p>
  
  <p>First the user hits the auth route</p>
  
  <pre><code>router.get('/steam',
      passport.authenticate('steam'),
      (req, res) =&gt; {
      //Not used
  });
  </code></pre>
  
  <p>Then after they login through steam they're returned to this route:</p>
  
  <pre><code>router.get('/steam/return',
      passport.authenticate('steam', { failureRedirect: '/' }),
      (req, res) =&gt; {
          res.redirect('/dashboard');
  });
  </code></pre>
  
  <p>From here I'm passing them to the /dashboard route where im taking the user object and creating another call to grab their library and then sending the data to the view:</p>
  
  <pre><code>router.get('/', (req, res, next) =&gt; {
      var OwnedGamesReqUri = 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=' + process.env.STEAM_API + '&amp;steamid=' + req.user.steamid + '&amp;format=json&amp;include_appinfo=1';
      request(OwnedGamesReqUri, (error, response, body) =&gt; {
        if (!error &amp;&amp; response.statusCode == 200) {
          var resObj = JSON.parse(body);
          //name, playtime_forever, playtime_2weeks, img_icon_url, img_logo_url
          res.render('dashboard', { user: req.user, games: resObj.response.games});
        }
      });
  });
  </code></pre>
  
  <p>I'm able to grab all of the data I need in the dashboard view via handlebars but the problem I'm facing is what I can do to pass the ownedgames data to a react object in another JS file. I have a react component set up in another file that is loaded to the dashboard via a bundle file. I'm assuming this needs to go to the server but I'm just not exactly sure how to achieve this.</p>