Method FindTokenAsync
- Namespace
- MailFathom.Application.Accounts
- Assembly
- MailFathom.Application.dll
FindTokenAsync(MailAccountId, CancellationToken)
Reads the stored refresh token for one account.
Task<MailboxRefreshToken?> FindTokenAsync(MailAccountId accountId, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account the token acts for.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<MailboxRefreshToken>
The token, which the caller owns and must dispose, or null when none is stored.
Remarks
An absent token is an ordinary answer rather than a failure: an account whose grant has never been stored is served from the refresh token its configuration references, which is what keeps a deployment that predates this store working unchanged.
Exceptions
- CryptographicException
Thrown when the stored value does not open under the key it names — a row restored from another deployment, a value moved between accounts, or an altered ciphertext.