XZise added a comment.
Maybe @Ricordisamoa with T78393: Load token types needed for each API module from the API https://phabricator.wikimedia.org/T78393 can help there. When a badtoken error happens their patch can determine which tokens need to be invalidated. As long as https://phabricator.wikimedia.org/T78393 is not fixed the handler could just invalidate all tokens or it could invalidate all tokens which appear as values in the parameters (which would work as good as the patch for https://phabricator.wikimedia.org/T78393).
TASK DETAIL https://phabricator.wikimedia.org/T61678
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: Rubin16, PhantomTech, Aklapper, Twp, NiharikaKohli, XZise, Sitic, Qgil, Daniel_Mietchen, jayvdb, valhallasw, Ricordisamoa, 555, Multichill, Ladsgroup, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org