mirror of
https://github.com/ppy/osu
synced 2024-12-30 19:02:27 +00:00
Merge pull request #13991 from peppy/fix-authentication-failure-unhandled
Fix authentication loss not handled correctly
This commit is contained in:
commit
6621da6752
@ -148,6 +148,16 @@ namespace osu.Game.Online.API
|
||||
|
||||
var userReq = new GetUserRequest();
|
||||
|
||||
userReq.Failure += ex =>
|
||||
{
|
||||
if (ex.InnerException is WebException webException && webException.Message == @"Unauthorized")
|
||||
{
|
||||
log.Add(@"Login no longer valid");
|
||||
Logout();
|
||||
}
|
||||
else
|
||||
failConnectionProcess();
|
||||
};
|
||||
userReq.Success += u =>
|
||||
{
|
||||
localUser.Value = u;
|
||||
@ -167,6 +177,7 @@ namespace osu.Game.Online.API
|
||||
// getting user's friends is considered part of the connection process.
|
||||
var friendsReq = new GetFriendsRequest();
|
||||
|
||||
friendsReq.Failure += _ => failConnectionProcess();
|
||||
friendsReq.Success += res =>
|
||||
{
|
||||
friends.AddRange(res);
|
||||
|
Loading…
Reference in New Issue
Block a user