Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise separate sign out for two different models

I have two models User and Admin(with RailsAdmin) that use Devise. I sign in as user and then sign in as admin. But the result of signing out from one of that models is signing out of two models at the same time. How can I fix it? Please, help :)

like image 650
Sergey Alekseev Avatar asked Mar 21 '12 19:03

Sergey Alekseev


1 Answers

The problem was in one string in config/initializers/devise.rb:

  • Default:

    # Configure sign_out behavior.
    # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
    # The default is true, which means any logout action will sign out all active scopes.
    # config.sign_out_all_scopes = true

  • Need:

    config.sign_out_all_scopes = false

like image 67
Sergey Alekseev Avatar answered Oct 23 '22 22:10

Sergey Alekseev