LoginSignup
3
3

More than 5 years have passed since last update.

rails_adminを更新したら認証を行わなくなってた

Posted at

RailsAdminを導入してみたの続き。

rails_adminを0.5から0.6.2に更新したら、認証の画面を介さずにいきなりログインできた。

コミットログを漁ってみたところ、0.6.1からデフォルトで認証を行わないようになってたらしい。

wikiを参考に、これまでと同じようにDeviseで認証を行うよう設定した:

RailsAdmin.config do |config|
  config.authenticate_with do
    warden.authenticate! scope: :user
  end
  config.current_user_method &:current_user
end

なおこのscopeというのは、routes.rbに書いているdevise_for :hogehoge:hogehogeの部分のことらしい。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3