Skip to content

Commit

Permalink
Merge pull request #21 from TORISOUP/fix_login
Browse files Browse the repository at this point in the history
ログイン時の例外対応
  • Loading branch information
TORISOUP authored Aug 28, 2023
2 parents d7d60bc + d883769 commit 0fe9858
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@ public static async UniTask<NiconicoUser> LoginAsync(string mail, string passwor
using var uwr = UnityWebRequest.Post(url, form);
uwr.redirectLimit = 0;

await uwr.SendWebRequest().ToUniTask(cancellationToken: ct);
try
{
await uwr.SendWebRequest().ToUniTask(cancellationToken: ct);
}
catch (Exception ex) when (ex is not OperationCanceledException)
{
// Redirect limit exceededは無視
if (!ex.Message.Contains("Redirect limit exceeded"))
{
throw;
}
}

var cookie = uwr.GetResponseHeader("Set-Cookie");
var match = userSessionRegex.Match(cookie);
Expand Down
2 changes: 1 addition & 1 deletion Assets/TORISOUP/NicoliveClient/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023.8.28
2023.8.28.1

0 comments on commit 0fe9858

Please sign in to comment.