mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 09:22:21 +00:00
Refactor: Explicitly define default return values for tuples and DateTime properties, and add System and System.Threading.Tasks usings.
This commit is contained in:
parent
bc1fbac530
commit
c55ad64ee3
@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Shared.Models.Online.Settings;
|
||||
|
||||
namespace Uaflix.Models
|
||||
|
||||
@ -8,6 +8,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Uaflix
|
||||
{
|
||||
@ -141,7 +142,7 @@ namespace Uaflix
|
||||
if (response.response == null)
|
||||
{
|
||||
_onLog("UaflixAuth: логін не вдався, немає HTTP-відповіді");
|
||||
return default;
|
||||
return (false, null, null);
|
||||
}
|
||||
|
||||
string body = response.content ?? string.Empty;
|
||||
@ -176,7 +177,7 @@ namespace Uaflix
|
||||
if (hasAuthError || !hasSession || !hasDleAuthCookie)
|
||||
{
|
||||
_onLog($"UaflixAuth: авторизація неуспішна, status={(int)response.response.StatusCode}");
|
||||
return default;
|
||||
return (false, null, null);
|
||||
}
|
||||
|
||||
_onLog("UaflixAuth: авторизація успішна");
|
||||
@ -185,7 +186,7 @@ namespace Uaflix
|
||||
catch (Exception ex)
|
||||
{
|
||||
_onLog($"UaflixAuth: помилка авторизації - {ex.Message}");
|
||||
return default;
|
||||
return (false, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,7 +258,7 @@ namespace Uaflix
|
||||
{
|
||||
HttpOnly = true,
|
||||
Expires = name.Equals("PHPSESSID", StringComparison.OrdinalIgnoreCase)
|
||||
? default
|
||||
? default(DateTime)
|
||||
: DateTime.UtcNow.AddMonths(6)
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user