1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-09-27 03:52:57 +02:00
bitwarden-mobile/src/Core/Abstractions/ITokenService.cs
Carlos Gonçalves 505426cd6a
[SG 547] Mobile username generator iOS.Extension UI changes (#2140)
* [SG-547] - Added button to generate username when using iOS extension

* [SG-547] - Missing changes from last commit

* SG-547 - Added missing interface method

* SG-547 - Added token renovation for iOS.Extension flow

* SG-547 Replaced generate buttons for icons

* SG-547 Removed unnecessary validation

* SG-547 - Fixed PR comments

* SG 547 - Missing file from last commit

* SG-547 - Fixed PR comments

* SG-547 - Renamed method
2022-10-25 21:05:15 +01:00

34 lines
1.1 KiB
C#

using System;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace Bit.Core.Abstractions
{
public interface ITokenService
{
Task ClearTokenAsync(string userId = null);
Task ClearTwoFactorTokenAsync(string email);
void ClearCache();
JObject DecodeToken();
string GetEmail();
bool GetEmailVerified();
string GetIssuer();
string GetName();
bool GetPremium();
Task<bool> GetIsExternal();
Task<string> GetRefreshTokenAsync();
Task<string> GetTokenAsync();
Task ToggleTokensAsync();
DateTime? GetTokenExpirationDate();
Task<string> GetTwoFactorTokenAsync(string email);
string GetUserId();
Task SetRefreshTokenAsync(string refreshToken);
Task SetAccessTokenAsync(string token, bool forDecodeOnly = false);
Task SetTokensAsync(string accessToken, string refreshToken);
Task SetTwoFactorTokenAsync(string token, string email);
bool TokenNeedsRefresh(int minutes = 5);
int TokenSecondsRemaining();
Task PrepareTokenForDecodingAsync();
}
}