Codebase list ruby-omniauth-facebook / b5c140d
update the example for client-side flow with the JS SDK Mark Dodwell 12 years ago
1 changed file(s) with 11 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
5353
5454 FB.login(function(response) {
5555 if (response.authResponse) {
56 $.get('/auth/facebook/callback');
56 $('#connect').html('Connected! Hitting OmniAuth callback (GET /auth/facebook/callback)...');
57
58 // since we have cookies enabled, this request will allow omniauth to parse
59 // out the auth code from the signed request in the fbsr_XXX cookie
60 $.getJSON('/auth/facebook/callback', function(json) {
61 $('#connect').html('Connected! Callback complete.');
62 $('#results').html(JSON.stringify(json));
63 });
5764 }
5865 }, { scope: '#{SCOPE}' });
5966 });
6067 });
6168 </script>
6269
63 <p>
70 <p id="connect">
6471 <a href="#">Connect to FB</a>
6572 </p>
73
74 <p id="results" />
6675 </body>
6776 </html>
6877 END