0

Web に OpenID 認証を追加したいと考えています。そのために、私はいくつかのチュートリアルに従い、いくつかのプラグインと宝石を使用ました。通常のログイン・パスワード認証、Facebook認証、Twitter認証も行っています。これら3つは完全に機能します。

今、Devise の をオーバーライドしようとしていますSession Controllerが、それを行うと、通常のログイン/パスワードが機能しなくなります。私が得るエラーは次のとおりです。

ActiveRecord::RecordNotFound in Sessions#create
     Couldn't find User without an ID 

残りの認証フォームは正常に機能し、サインアップも完璧に機能します。ログイン/パスワード認証方式のみです...

Rails 3.0.1、Ruby 1.8.9、Devise 1.4.9 を使用しています。

ルート.rb

MAWeb::Application.routes.draw do

[...]

  devise_for :admins
  devise_for :users, :controllers => {:registrations => 'registrations', :sessions => 'sessions'}
  match '/users/openid' => 'users#openid_sign_in'
  match 'openid/sign_in' => 'openid#sign_in', :as => :openid_sign_in
  get 'openid/create'

  match '/auth/:provider/callback' => 'authentications#create'
  match '/auth/failure' => 'authentications#failure'

  resources :subscription_contact_datas

  resources :subscription_preferences do
    collection do
      post :create_with_params
    end
    member do
      get 'delete_tag'
    end
    get 'fill_event_id', :on => :member
  end
  resources :event_states

  resources :subscription_profiles do
    collection do
      put :update_profiles
    end
  end

  resources :event_criteria_options

  resources :subscriptions do
    collection do
      get :options_for_event_criteria
    end

  end

  resources :event_criterias
  resources :categories
  resources :user_infos do
      member do
        get 'edit'
      end
  end

  resources :events 

  resources :users do
    member do
      get 'showUserActivity'
    end
  end 

  resources :admins

  resources :subscriptions_from_poi

  root :to => "home#index"

  namespace :user do
    root :to => "users#index"
  end

  namespace :admin do
    root :to => "admins#index"
  end

*登録コントローラーのオーバーライドは完全に機能します

編集:ほとんどのルートを追加しました。私が省略したものは、私の意見では重要ではありません。

4

0 に答える 0