Initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using RudderSdk.Core.Abstractions;
|
||||
|
||||
namespace RudderSdk.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Default <see cref="ITokenStore"/> keeping tokens in memory only. Sessions do
|
||||
/// not survive an app restart; provide a durable implementation for production.
|
||||
/// </summary>
|
||||
public sealed class InMemoryTokenStore : ITokenStore
|
||||
{
|
||||
private string? _accessToken;
|
||||
private string? _refreshToken;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string? GetAccessToken() => _accessToken;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string? GetRefreshToken() => _refreshToken;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SaveTokens(string accessToken, string refreshToken)
|
||||
{
|
||||
_accessToken = accessToken;
|
||||
_refreshToken = refreshToken;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Clear()
|
||||
{
|
||||
_accessToken = null;
|
||||
_refreshToken = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user