htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Add htmx:redirectReceived event

Open wimdeblauwe opened this issue 3 years ago • 0 comments

When a user is no longer logged on and htmx does a request, the server will typically respond with a redirect to the login page. However, this will break usually in 2 ways:

  1. The html of the login page will be put where something else was expected.
  2. If the auth server is on a different location, cors will not allow htmx to do the request.

If there would be a htmx:redirectReceived event, then we could force a full page refresh on the client side.

PS: There is also the option that the server puts the X-Refresh: true in the response, but this is not always possible to add.

wimdeblauwe avatar Sep 23 '22 06:09 wimdeblauwe