Skip to content

Instantly share code, notes, and snippets.

@foca
Created January 30, 2012 17:13
Show Gist options
  • Save foca/1705495 to your computer and use it in GitHub Desktop.
Save foca/1705495 to your computer and use it in GitHub Desktop.
class Store::OmniauthCallbacksController < Devise::OmniauthCallbacksController
# GET /store/auth/:provider/callback
def success
auth_hash = request.env.fetch("omniauth.auth")
user = User::Authorization.authorize(auth_hash)
sign_in_and_redirect user
end
# This is stupid, devise
alias_method :twitter, :success
alias_method :facebook, :success
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment