Skip to content

Instantly share code, notes, and snippets.

@happyrobots
Created February 21, 2011 12:33
Show Gist options
  • Save happyrobots/836992 to your computer and use it in GitHub Desktop.
Save happyrobots/836992 to your computer and use it in GitHub Desktop.
# https://github.com/arsduo/koala/wiki
# https://github.com/arsduo/koala/wiki/Test-Users
# routes.rb
match ‘/auth/failure’, :to => ‘profiles#failure’
# profiles_controller.rb
class ProfilesController < ApplicationController
def failure
redirect_to login_url, :flash => {:alert => "Could not log you in. #{params[:message]}"}
end
end
# https://github.com/plataformatec/devise/wiki/OmniAuth:-Testing
# config/omniauth.rb
if Rails.env == "production"
# no production app yet
else
if ENV['USER'] == 'monica'
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET'
provider :facebook, 'APP_ID', 'APP_SECRET' # Find these values on the Facebook App page
end
end
end
# login page
<%= link_to "Log in with Facebook", "/auth/facebook" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment