Add how-it-works steps to home page and fix post-OAuth redirect

- Add three-step explanation (Search, Review, Save or skip) below the
  search form on the index page
- After a LoginNeeded during save, redirect to OAuth with next= pointing
  back to the article page showing the same candidate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Edward Betts 2026-05-11 15:22:01 +01:00
parent 25056aaf33
commit 5ba380d590
2 changed files with 33 additions and 3 deletions

View file

@ -318,7 +318,8 @@ def handle_post(url_title: str) -> Response:
try:
do_save(from_title, hit_title)
except mediawiki_oauth.LoginNeeded:
return flask.redirect(flask.url_for("start_oauth"))
next_url = flask.url_for("article_page", url_title=url_title, title=hit_title)
return flask.redirect(flask.url_for("start_oauth", next=next_url))
except (mediawiki_api.APIError, api.MediawikiError) as e:
return flask.make_response(
flask.render_template("error.html", message=f"Save failed: {e}"), 502