I am creating an application with two fairly separate models using devus for auth. As soon as you enter the house, everyone in the house can enter as a resident of this house. Everything works fine, except when I exit a resident session using
destroy_resident_session
The only problem is that it also kills the home session, as it causes
Devise::SessionsController#destroy
I tried to create a user session for residents, here is my code below:
class SessionsController < Devise::SessionsController
This gives an error:
undefined local variable or method `resident'
Maybe I'm wrong in the logic of the method, but it seems to me that I want to change the following line in the development controller:
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
Since I do not want to leave all areas, this is only a field of residency.
solvable
All I had to do was install
config.sign_out_all_scopes = false
in
config/devise.rb
Also, do not forget to restart my server :)
source share