Signing out User with Devise is signing out the AdminUser as well

activeadmin, devise, ruby-on-rails-3

Solution

What you are looking for is a Devise configuration called `sign_out_all_scopes`

When a user signs out and it is set to true, all scopes are signed out for this user, both user and admin in your case.

In devise.rb search for sign_out_all_scopes and change its value to true.

Problem

I am using Devise for my User model. I am also using ActiveAdmin which is using Devise as well for the AdminUser model. I can sign in using an admin_user and a user independently of each other, but I have noticed if I sign out the User, the AdminUser is signed out as well. The same thing happens if I reverse it and sign out the AdminUser first. What can I do to hopefully get around this? routes.rb ``` devise_for :admin_users, ActiveAdmin::Devise.config devise_for :users get "dashboard/home" ``` ApplicationController ``` protected def after_sign_in_path_for(resource) if resource.is_a?(User) stored_location_for(:user) || dashboard_home_path elsif resource.is_a?(AdminUser) stored_location_for(:admin_user) || admin_root_path(resource) end end ```

Original source