Permalink
Browse files

works mostly

  • Loading branch information...
1 parent e71e922 commit e34d7861890ac0b67f8260f6c8898a50098113c5 Holden Thomas committed Nov 5, 2010
Showing with 15 additions and 4 deletions.
  1. +0 −4 README.rdoc
  2. +15 −0 app/controllers/users/omniauth_callbacks_controller.rb
View
@@ -1,7 +1,3 @@
== Rails3 Omniauth-Devise supercombo
As bare as you could get devise-omniauth combo
-
-but doesn't work yet...
-
-can't get past: "ActionController::RoutingError (uninitialized constant Users)"
@@ -0,0 +1,15 @@
+class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
+ def facebook
+ # # You need to implement the method below in your model
+ # @user = User.find_for_facebook_oauth(env["omniauth.auth"], current_user)
+ @user = User.find(1)
+ #
+ if @user.persisted?
+ flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
+ sign_in_and_redirect @user, :event => :authentication
+ else
+ session["devise.facebook_data"] = env["omniauth.auth"]
+ redirect_to new_user_registration_url
+ end
+ end
+end

0 comments on commit e34d786

Please sign in to comment.