diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 4f586c8fff..a3ceb14a40 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -540,6 +540,11 @@ namespace osu.Game.Online.API /// Failing, + /// + /// Waiting on second factor authentication. + /// + RequiresAuthentication, + /// /// We are in the process of (re-)connecting. /// diff --git a/osu.Game/Online/API/DummyAPIAccess.cs b/osu.Game/Online/API/DummyAPIAccess.cs index d585124db6..4cf2152193 100644 --- a/osu.Game/Online/API/DummyAPIAccess.cs +++ b/osu.Game/Online/API/DummyAPIAccess.cs @@ -55,6 +55,7 @@ namespace osu.Game.Online.API private bool shouldFailNextLogin; private bool stayConnectingNextLogin; + private bool requiresTwoFactor; /// /// The current connectivity state of the API. @@ -115,7 +116,13 @@ namespace osu.Game.Online.API Id = DUMMY_USER_ID, }; - state.Value = APIState.Online; + if (requiresTwoFactor) + { + state.Value = APIState.RequiresAuthentication; + requiresTwoFactor = false; + } + else + state.Value = APIState.Online; } public void Logout() @@ -142,6 +149,8 @@ namespace osu.Game.Online.API IBindableList IAPIProvider.Friends => Friends; IBindable IAPIProvider.Activity => Activity; + public void RequireTwoFactor() => requiresTwoFactor = true; + /// /// During the next simulated login, the process will fail immediately. ///