Skip to content

Commit

Permalink
Merge pull request #25029 from peppy/socket-exception-handling
Browse files Browse the repository at this point in the history
Fix OAuth refresh attempt when no network available causing full logout (part 2)
  • Loading branch information
bdach committed Oct 6, 2023
2 parents a099cc0 + c78b511 commit 250b911
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion osu.Game/Online/API/OAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System;
using System.Diagnostics;
using System.Net.Http;
using System.Net.Sockets;
using Newtonsoft.Json;
using osu.Framework.Bindables;

Expand Down Expand Up @@ -99,14 +100,19 @@ internal bool AuthenticateWithRefresh(string refresh)
return true;
}
}
catch (SocketException)
{
// Network failure.
return false;
}
catch (HttpRequestException)
{
// Network failure.
return false;
}
catch
{
// Force a full re-reauthentication.
// Force a full re-authentication.
Token.Value = null;
return false;
}
Expand Down

0 comments on commit 250b911

Please sign in to comment.