has anyone here come up with a clean way to handle session expiration? I'm doing an htmx request, but if the session has expired I want to redirect them to the login page. Currently the whole login page gets rendered, since I protect my views with a @login_required, and then swapped into the hx-target creating a "pageception". A couple of ways I'm thiking would fix this:
1) wrap django's
login_required
with my own logic that adds a
HX-Redirect=/login
to the response in case we need to re login
2) have the login view return a
HX-Retarget=body
to have the content be swapped by the whole page.
3) any other ideas?