Initial commit
This commit is contained in:
20
MealPlan.Api/Services/IRefreshTokenStore.cs
Normal file
20
MealPlan.Api/Services/IRefreshTokenStore.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using MealPlan.Api.Models;
|
||||
|
||||
namespace MealPlan.Api.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Stores issued refresh tokens. Backed by an in-memory implementation because the
|
||||
/// existing database schema must not be modified and no migrations may be added.
|
||||
/// </summary>
|
||||
public interface IRefreshTokenStore
|
||||
{
|
||||
void Add(RefreshToken token);
|
||||
|
||||
RefreshToken? Get(string token);
|
||||
|
||||
/// <summary>Marks a token revoked. Returns the revoked token if it existed and was active.</summary>
|
||||
RefreshToken? Revoke(string token);
|
||||
|
||||
/// <summary>Removes expired/revoked tokens to bound memory usage.</summary>
|
||||
void RemoveExpired();
|
||||
}
|
||||
Reference in New Issue
Block a user