Capture 2FA authentication edge cases

Fix #919