update the example for client-side flow with the JS SDK
Mark Dodwell
12 years ago
53 | 53 | |
54 | 54 | FB.login(function(response) { |
55 | 55 | 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 | }); | |
57 | 64 | } |
58 | 65 | }, { scope: '#{SCOPE}' }); |
59 | 66 | }); |
60 | 67 | }); |
61 | 68 | </script> |
62 | 69 | |
63 | <p> | |
70 | <p id="connect"> | |
64 | 71 | <a href="#">Connect to FB</a> |
65 | 72 | </p> |
73 | ||
74 | <p id="results" /> | |
66 | 75 | </body> |
67 | 76 | </html> |
68 | 77 | END |