ruby on rails - Unknown action The action 'linkedin' could not be found for Devise::OmniauthCallbacksController -
i'm trying implement open authorization within rails app users can log in linkedin accounts. when click on link go linkedin authorization page, , confirm linkedin credentials, error within app:
unknown action action 'linkedin' not found devise::omniauthcallbackscontroller
i'm positive issues lies within routes file. many tutorials call following line added:
devise_for :users, :controllers => { :omniauth_callbacks => "omniauth_callbacks" }
however, have line here custom devise logins:
devise_for :users, :controllers => { :registrations => "registrations" }
i tried switching them didn't work (as expected). there way combine 2 statements?
thanks!
issue omniauth_callbacks_controller: the action 'linkedin' not found omniauthcallbackscontroller
class omniauthcallbackscontroller < applicationcontroller class omniauthcallbackscontroller < devise::omniauthcallbackscontroller def linkedin auth = env["omniauth.auth"] @user = user.connect_to_linkedin(request.env["omniauth.auth"],current_user) if @user.persisted? flash[:notice] = i18n.t "devise.omniauth_callbacks.success" sign_in_and_redirect @user, :event => :authentication else session["devise.linkedin_uid"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end end end
use
devise_for :users, :controllers => { :registrations => "registrations", :omniauth_callbacks => "omniauth_callbacks"}
this means customizing devise's registrationscontroller
, omniauthcallbackscontroller
.
for example:
class omniauthcallbackscontroller < devise::omniauthcallbackscontroller ... end
and
class registrationscontroller < devise::registrationscontroller ... end
Comments
Post a Comment