Table of Contents

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

accountId MailAccountId

The account the grant acts for.

refreshToken MailboxRefreshToken

The token to record. The caller keeps ownership of it.

cancellationToken CancellationToken

Propagates 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 refreshToken is null.

MailAccountNotAccessibleException

Thrown when this deployment serves no account with that identifier.