mirror of https://github.com/ppy/osu
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:
commit
250b9112c4
|
@ -6,6 +6,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
using System.Net.Sockets;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
|
||||||
|
@ -99,6 +100,11 @@ internal bool AuthenticateWithRefresh(string refresh)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (SocketException)
|
||||||
|
{
|
||||||
|
// Network failure.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
catch (HttpRequestException)
|
catch (HttpRequestException)
|
||||||
{
|
{
|
||||||
// Network failure.
|
// Network failure.
|
||||||
|
@ -106,7 +112,7 @@ internal bool AuthenticateWithRefresh(string refresh)
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
// Force a full re-reauthentication.
|
// Force a full re-authentication.
|
||||||
Token.Value = null;
|
Token.Value = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue