How to hijack the route response? I have a configuration form that if it wasn't previousely configured should be the only thing that the user is able to see.

I would like to hijack the response for the current page and display the form, no matter what url the user is currently on. I could do a redirect but I would rather learn how to do it this way.

I presume this is done via EventSubscriber, I'm just not exactly sure how. Do I have to render the form and set is as response? Or can I just alter the controller for active route? Which would seem more DX friendly to me.

*I am not looking for contrib module to do this.

--

I was looking at the kernel events but the only viable events were


request - which already had the route "loaded"
controller - which is fine but in most cases it requires DI stuff so I cannot swap it so easily, and
response - too late, creating a new repsonse is not good for performance
It could be done with Rules:


  The Rules module allows site administrators to define conditionally
  executed actions based on occurring events (known as reactive or ECA
  rules). It's a replacement with more features for the trigger module
  in core and the successor of the Drupal 5 workflow-ng module.



set up a field for the user, boolean and use Field Permissions to hide it from users:



  The Field Permissions module allows site administrators to set
  field-level permissions to edit, view and create fields on any entity.



Rules, Event - Drupal is Initialising
Condition - Data field is empty, user field previously set up
Action - redirect to form


Then you can set up an override for the form submit to set the user data field (or use Rules to do it), so that the condition is no longer met.