Unhandled exception when logging in with MFA

Observed Behavior:

Attempts to log-in with MFA enabled throws an unhandled exception:

msort() was passed a method (“newSortMethod”) which returns “PhutilSortVector” objects. Use “msortv()”, not “msort()”, to sort a list which produces vectors.

Expected Behavior:

Just log in, without any exceptions.

Phabricator Version:

Using master branch Git HASH aba7c98baed.

Reproduction Steps:

  • Enable MFA
  • Try to login

The actual fix is probably as simple as doing $factors = msortv($factors, 'newSortVector'); in PhabricatorAuthSessionEngine.php (this is how PhabricatorAuthFactorProviderEditController.php does it).

P.S. There is also PhabricatorMultiFactorSettingsPanel.php which uses msort() instead for a similar sort.

Thanks! This should be fixed by https://secure.phabricator.com/D20587.