Method RecordAsync
- Namespace
- MailFathom.Application.Accounts
- Assembly
- MailFathom.Application.dll
RecordAsync(MailAccountId, MailboxRefreshToken, CancellationToken)
Records the refresh token for one served account, replacing whatever was stored for it before.
public Task RecordAsync(MailAccountId accountId, MailboxRefreshToken refreshToken, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account the grant acts for.
refreshTokenMailboxRefreshTokenThe token to record. The caller keeps ownership of it.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task
A task that completes after durable storage.
Remarks
Recording is idempotent in the account, because re-authorizing a mailbox is what an operator does after a revocation and a second grant beside the first would leave the account holding a credential nothing chose between. The store owns that guarantee; this use case adds only the account check in front of it.
Exceptions
- ArgumentNullException
Thrown when
refreshTokenis null.- MailAccountNotAccessibleException
Thrown when this deployment serves no account with that identifier.