diff --git a/.gitignore b/.gitignore index 275f0fe..ae44b2c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,3 @@ pkg/* .powenv tmp bin -example/app.log diff --git a/example/app.rb b/example/app.rb index a078746..142da58 100644 --- a/example/app.rb +++ b/example/app.rb @@ -6,88 +6,79 @@ require 'yaml' set :run, false set :raise_errors, true -# setup logging to file -log = File.new("app.log", "a+") -$stdout.reopen(log) -$stderr.reopen(log) -$stderr.sync = true -$stdout.sync = true - -# server-side flow +# REQUEST STEP (server-side flow) get '/server-side' do - # NOTE: You would just hit this endpoint directly from the browser in a real app. The redirect is just here to - # explicit declare this server-side flow. + # NOTE: You would just hit this endpoint directly from the browser in a real app. The redirect is + # just here to explicit declare this server-side flow. redirect '/auth/facebook' end -# client-side flow +# REQUEST STEP (client-side flow) get '/client-side' do content_type 'text/html' - # NOTE: When you enable cookie below in the FB.init call the GET request in the FB.login callback will send a signed - # request in a cookie back the OmniAuth callback which will parse out the authorization code and obtain an - # access_token with it. - <<-END + # NOTE: When you enable cookie below in the FB.init call the GET request in the FB.login callback + # will send a signed request in a cookie back the OmniAuth callback which will parse out the + # authorization code and obtain an access_token with it. + <<-HTML