Background
Currently ApiEditPage is the only API that creates a temporary account.
Other APIs need to do the same. The general workflow is described here (from T340540#9201679):
- accept "returnto" parameters 2) if logged-out, create an unsaved temp user at the start 3) use it for permission checks throughout 4) once you've checked everything and are sure that the action will go through, save the user 5) return whether a temp user was created, and the result of running the onTempUserCreatedRedirect() hook with the "returnto" parameters. However, a lot of this logic could probably be shared, using something similar to ApiWatchlistTrait.
What needs doing
This example shows what another API needed to copy from ApiEditPage, that should be moved into a trait :
QA Results - Local
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | https://phabricator.wikimedia.org/T349223#9304729 here |