Page MenuHomePhabricator

Clean up HTMLForm hack for 2FA login buttons in OATHAuth
Open, Needs TriagePublic

Description

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/OATHAuth/+/1186136 introduces some terrible hackery to display multiple buttons that each set a different value for the newModule field. HTMLForm really doesn't want to let you do this.

To make this cleaner, we should introduce an HTMLFormField subclass (initially in OATHAuth, we can upstream it to core later) that implements a group of buttons with the same name (similar to radio buttons, but with submit buttons instead).

Event Timeline

This would also be a good opportunity to fix T406584. Creating an HTMLFormField subclass for this should allow us to decouple the name(s) of the query string parameter(s) from the name of the form field, which would let us get away from all the buttons having the same name attribute and instead give each of them a different name.