Users.Logout methods redirect the user to the homepage, but should redirect the user to the page from which they came. E.g., if the user is trying to edit a bout and redirected to the login page, they should be redirected back to that bout to resume editing.
Add a hidden
return_to field in the login form with a URL to redirect back to. Links to log in or out should include a
return_to parameter. Then parse
return_to from the URL or form (depending on situation) and redirect there.
After core functionality is implemented. This is a convenience feature.
Sourcehut does a great job with this and uses Option 1.