Ref T13249. Poll for Duo updates in the background so we can automatically update the UI when the user clicks the mobile phone app button.
Details
- Reviewers
amckinley - Maniphest Tasks
- T13249: 2019 Week 7 - 10 Bonus Content
- Commits
- rP2ca316d652d8: When users confirm Duo MFA in the mobile app, live-update the UI
Hit a Duo gate, clicked "Approve" in the mobile app, saw the UI update immediately.
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
src/applications/auth/factor/PhabricatorAuthFactor.php | ||
---|---|---|
213 | We don't actually use this anywhere, so I removed it. | |
src/applications/auth/factor/PhabricatorDuoAuthFactor.php | ||
588 | I reduced this timeout slightly since the Duo API seems pretty responsive, we have the live update thing now, and the 5-second timer can mean that some normal page responses wait 5 seconds, which feels icky. Specifically:
The second dialog takes 5 seconds to come up since we're checking the status of the current active challenge and have to wait for the call to timeout if you don't press the button during those 5 seconds. | |
684–689 | This default result moved here so it can have access to $challenges. |
webroot/rsrc/js/phui/behavior-phui-timer-control.js | ||
---|---|---|
37 | Was this supposed to be 1000? |
webroot/rsrc/js/phui/behavior-phui-timer-control.js | ||
---|---|---|
37 | This one's intentionally 10,000: so the AJAX endpoint can long-poll for 5 seconds. The other one is 1,000: wait one second between retries. A "phutil_units" equivalent would be nice in JS, but we don't currently have one. |