Merge pull request #25029 from peppy/socket-exception-handling

Fix OAuth refresh attempt when no network available causing full logout (part 2)
This commit is contained in:
Bartłomiej Dach 2023-10-06 21:59:27 +02:00 committed by GitHub
commit 250b9112c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@
using System;
using System.Diagnostics;
using System.Net.Http;
using System.Net.Sockets;
using Newtonsoft.Json;
using osu.Framework.Bindables;
@ -99,6 +100,11 @@ internal bool AuthenticateWithRefresh(string refresh)
return true;
}
}
catch (SocketException)
{
// Network failure.
return false;
}
catch (HttpRequestException)
{
// Network failure.
@ -106,7 +112,7 @@ internal bool AuthenticateWithRefresh(string refresh)
}
catch
{
// Force a full re-reauthentication.
// Force a full re-authentication.
Token.Value = null;
return false;
}