Active Admin authentication conflicting with User authentication

后端 未结 4 1345
你的背包
你的背包 2021-01-02 03:07

Active Admin is a gem used for having an admin dashboard in your application. It uses Devise for logging in users and creates a separate admin_user model for th

4条回答
  •  無奈伤痛
    2021-01-02 03:28

    I was able to solve this. The issue was related to Devise expecting a single user model in the application. Here is how to fix it.

    In the config/initializers/devise.rb file, add:

    config.scoped_views = true
    

    and

    config.default_scope = :user #or whichever is your regular default user model
    

    thats it, warden checks the :user for being logged in and not :admin_user

提交回复
热议问题