27 lines
1.0 KiB
C#
27 lines
1.0 KiB
C#
namespace adas_core.Domain.Models.Responses;
|
|
|
|
/// <summary>
|
|
/// Represents the response data returned from a login operation.
|
|
/// </summary>
|
|
public class LoginResponse
|
|
{
|
|
public string Token { get; set; } = "";
|
|
public string RefreshToken { get; set; } = "";
|
|
public DateTime Expiration { get; set; } = DateTime.MinValue;
|
|
|
|
/// <summary>
|
|
/// Determines whether the item has expired by comparing its <see cref="Expiration"/> value to the current UTC time.
|
|
/// Returns <c>true</c> when the expiration date has passed, or when no expiration date has been set (i.e., <see cref="DateTime.MinValue"/>), treating unset expirations as expired.
|
|
/// </summary>
|
|
/// <returns><c>true</c> if the item is expired or has no expiration date set; otherwise, <c>false</c>.</returns>
|
|
public bool IsExpired()
|
|
{
|
|
if (Expiration != DateTime.MinValue)
|
|
{
|
|
if (Expiration < DateTime.UtcNow) return true;
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
} |