Abstraction of authenticators. Reworked Gmail authentication.

This commit is contained in:
Burak Kaan Köse
2024-11-20 01:45:48 +01:00
parent 8367efa174
commit 7fad15524f
44 changed files with 354 additions and 605 deletions

View File

@@ -5,5 +5,6 @@
/// </summary>
/// <param name="SenderName">Display sender name for the account.</param>
/// <param name="Base64ProfilePictureData">Base 64 encoded profile picture data of the account. Thumbnail size.</param>
public record ProfileInformation(string SenderName, string Base64ProfilePictureData);
/// <param name="AccountAddress">Address of the profile.</param>
public record ProfileInformation(string SenderName, string Base64ProfilePictureData, string AccountAddress);
}

View File

@@ -1,20 +0,0 @@
using System;
namespace Wino.Core.Domain.Models.Authentication
{
public class TokenInformationBase
{
public string AccessToken { get; set; }
public string RefreshToken { get; set; }
/// <summary>
/// UTC date for token expiration.
/// </summary>
public DateTime ExpiresAt { get; set; }
/// <summary>
/// Gets the value indicating whether the token is expired or not.
/// </summary>
public bool IsExpired => DateTime.UtcNow >= ExpiresAt;
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Core.Domain.Models.Authentication
{
/// <summary>
/// Previously known as TokenInformation.
/// We used to store this model in the database.
/// Now we store it in the memory.
/// </summary>
/// <param name="AccessToken">Access token/</param>
/// <param name="AccountAddress">Address of the authenticated user.</param>
public record TokenInformationEx(string AccessToken, string AccountAddress);
}