app/controllers/application_controller.rb
def remove_vicarious_login
      session[:user] = session[:original_user]
      session[:original_user] = nil
      session[:vicarious_token] = nil
      session[:vicarious_user] = nil      
      # redirect_to :redirect_root
      redirect_back(fallback_location: root_path)
  end
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def remove_vicarious_login
      session[:user] = session[:original_user]
      session[:original_user] = nil
      session[:vicarious_token] = nil
      session[:vicarious_user] = nil      
      redirect_back(fallback_location: root_path)
  end
def remove_vicarious_login session [ :user ] = session [ :original_user ] session [ :original_user ] = nil session [ :vicarious_token ] = nil session [ :vicarious_user ] = nil redirect_back ( fallback_location : root_path ) end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .
# redirect_to :redirect_root