htmx
htmx copied to clipboard
Add htmx:redirectReceived event
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:
- The html of the login page will be put where something else was expected.
- 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.