Package list ruby-omniauth-facebook / 2de8e13
[skip ci] Unify ENV name to "FACEBOOK_KEY" and "FACEBOOK_SECRET" (#328) * Use "FACEBOOK_APP_ID" and "FACEBOOK_APP_SECRET" in README "APP_ID" is not a good name since users might use more than two auth providers and then it doesn't make sense. "FACEBOOK_APP_ID" and "FACEBOOK_APP_SECRET" is more reasonable. * Rename ENV in examples as well OKURA Masafumi authored 2 years ago Josef Šimánek committed 2 years ago
3 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
2525
2626 ```ruby
2727 Rails.application.config.middleware.use OmniAuth::Builder do
28 provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET']
28 provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET']
2929 end
3030 ```
3131
5050
5151 ```ruby
5252 Rails.application.config.middleware.use OmniAuth::Builder do
53 provider :facebook, ENV['APP_ID'], ENV['APP_SECRET'],
53 provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET'],
5454 scope: 'email,user_birthday,read_stream', display: 'popup'
5555 end
5656 ```
6161
6262 ```ruby
6363 use OmniAuth::Builder do
64 provider :facebook, ENV['APP_ID'], ENV['APP_SECRET'],
64 provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET'],
6565 client_options: {
6666 site: 'https://graph.facebook.com/v3.0',
6767 authorize_url: "https://www.facebook.com/v3.0/dialog/oauth"
2626 <script type="text/javascript">
2727 window.fbAsyncInit = function() {
2828 FB.init({
29 appId: '#{ENV['APP_ID']}',
29 appId: '#{ENV['FACEBOOK_APP_ID']}',
3030 version: 'v2.10',
3131 cookie: true // IMPORTANT must enable cookies to allow the server to access the session
3232 });
44 use Rack::Session::Cookie, secret: 'abc123'
55
66 use OmniAuth::Builder do
7 provider :facebook, ENV['APP_ID'], ENV['APP_SECRET']
7 provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET']
88 end
99
1010 run Sinatra::Application