def require_login
      debug "!!!!!!!!!!!!!!!!!! controller#require_login " # logged_in? #{logged_in?}"
      unauthorized unless logged_in?
      message = catch(:failure) do
        current_user = authenticate_session.current_user
        Authenticate.lifecycle.run_callbacks(:after_set_user, current_user, authenticate_session, event: :set_user)
      end
      unauthorized(message) if message
    end
def require_login
      debug "!!!!!!!!!!!!!!!!!! controller#require_login " # logged_in? #{logged_in?}"
      unauthorized unless logged_in?
      message = catch(:failure) do
        current_user = authenticate_session.current_user
        Authenticate.lifecycle.run_callbacks(:after_set_user, current_user, authenticate_session, event: :set_user)
      end
      unauthorized(message) if message
    end
Use this filter as a before_action to control access to controller actions,
 limiting to logged in users.

 Placing in application_controller will control access to all controllers.

 Example:

   class ApplicationController < ActionController::Base
     before_action :require_login

     def index
       # ...
     end
   end