init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Client.FileService;
|
||||
|
||||
namespace Kreta.BusinessLogic.Helpers
|
||||
{
|
||||
internal class TokenServiceHelper : ITokenServiceHelper
|
||||
{
|
||||
private readonly IFileServiceClient fileServiceClient;
|
||||
|
||||
public TokenServiceHelper(IFileServiceClient fileServiceClient)
|
||||
{
|
||||
this.fileServiceClient = fileServiceClient ?? throw new ArgumentNullException(nameof(fileServiceClient));
|
||||
}
|
||||
|
||||
public (string, int) GetPublicTokenWithExpiresIn()
|
||||
{
|
||||
var response = fileServiceClient.GetPublicToken();
|
||||
|
||||
return (response.AccessToken, response.ExpiresIn);
|
||||
}
|
||||
|
||||
public (string, int) GetPrivateTokenWithExpiresIn()
|
||||
{
|
||||
var response = fileServiceClient.GetPrivateToken();
|
||||
|
||||
return (response.AccessToken, response.ExpiresIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user