Abstraction of authenticators. Reworked Gmail authentication.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
11
Wino.Core.Domain/Models/Authentication/TokenInformationEx.cs
Normal file
11
Wino.Core.Domain/Models/Authentication/TokenInformationEx.cs
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user