Files
Artemis/src/Artemis.WebClient.Workshop/Repositories/AuthenticationRepository.cs
T
RobertBeekman 551921db9f Storage - Replace LiteDB with SQLite + EF Core (#843)
Storage - Added LiteDB to SQLite migration
UI - Try to die a bit more gracefully
Core - Delay start watching plugins for hot reload after initializing
UI - Simplify category management logic
UI - Avoid crash during profile icon load
Storage - Fix entry metadata retrieval
2024-03-13 20:19:21 +01:00

35 lines
992 B
C#

using Artemis.Core;
using Artemis.Core.Services;
namespace Artemis.WebClient.Workshop.Repositories;
internal class AuthenticationRepository : IAuthenticationRepository
{
private readonly PluginSetting<string> _refreshToken;
public AuthenticationRepository(ISettingsService settingsService)
{
// Of course anyone can grab these indirectly, but that goes for whatever we do.
// ISettingsService is a protected service so we at least don't make it very straightforward.
_refreshToken = settingsService.GetSetting<string>("Workshop.RefreshToken");
}
/// <inheritdoc />
public void SetRefreshToken(string? refreshToken)
{
_refreshToken.Value = refreshToken;
_refreshToken.Save();
}
/// <inheritdoc />
public string? GetRefreshToken()
{
return _refreshToken.Value;
}
}
internal interface IAuthenticationRepository
{
void SetRefreshToken(string? refreshToken);
string? GetRefreshToken();
}