2024-04-18 01:44:37 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using SQLite;
|
|
|
|
|
|
using Wino.Core.Domain.Models.Authentication;
|
|
|
|
|
|
|
2024-11-10 23:28:25 +01:00
|
|
|
|
namespace Wino.Core.Domain.Entities.Shared
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
|
|
|
|
|
public class TokenInformation : TokenInformationBase
|
|
|
|
|
|
{
|
|
|
|
|
|
[PrimaryKey]
|
|
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public Guid AccountId { get; set; }
|
|
|
|
|
|
|
2024-08-05 00:36:26 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Unique object storage for authenticators if needed.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string UniqueId { get; set; }
|
2024-04-18 01:44:37 +02:00
|
|
|
|
public string Address { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public void RefreshTokens(TokenInformationBase tokenInformationBase)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (tokenInformationBase == null)
|
|
|
|
|
|
throw new ArgumentNullException(nameof(tokenInformationBase));
|
|
|
|
|
|
|
|
|
|
|
|
AccessToken = tokenInformationBase.AccessToken;
|
|
|
|
|
|
RefreshToken = tokenInformationBase.RefreshToken;
|
|
|
|
|
|
ExpiresAt = tokenInformationBase.ExpiresAt;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|