def deny_access(exception)
      if current_user&.persisted?
        redirect_to root_path, alert: exception.message
      else
        session['user_return_to'.freeze] = request.url
        redirect_to main_app.new_user_session_path, alert: exception.message
      end
    end
def deny_access(exception)
      if current_user&.persisted?
        redirect_to root_path, alert: exception.message
      else
        session['user_return_to'.freeze] = request.url
        redirect_to main_app.new_user_session_path, alert: exception.message
      end
    end
Overriding the default behavior from Hydra::Core::ControllerBehavior