28 lines
731 B
C#
28 lines
731 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CPRNIMS.Infrastructure.Models.Account
|
|
{
|
|
public class TokenInfo
|
|
{
|
|
public string? AccessToken { get; set; }
|
|
public string? RefreshToken { get; set; }
|
|
public DateTime ExpiresAt { get; set; }
|
|
public DateTime IssuedAt { get; set; }
|
|
public Dictionary<string, string>? Claims { get; set; }
|
|
|
|
public bool IsExpiringSoon(int minutesThreshold = 5)
|
|
{
|
|
return DateTime.UtcNow.AddMinutes(minutesThreshold) >= ExpiresAt;
|
|
}
|
|
|
|
public bool IsExpired()
|
|
{
|
|
return DateTime.UtcNow >= ExpiresAt;
|
|
}
|
|
}
|
|
}
|