AniLink - v3.0.0
    Preparing search index...

    Function rewriteAuth

    • Builds the auth material an operation replays with after a refresh.

      The swap replaces the bearer token and preserves the other headers the caller attached to structured auth, such as proxy or tracing headers. It removes headers listed by the descriptor. MAL strips its client-ID header because the replay uses the bearer token; keeping the old header would expose the client ID to intermediaries that log request headers. An empty headers object becomes undefined.

      Parameters

      • descriptor: TokenGrantDescriptor

        The provider descriptor whose stripHeaders rule the rewrite applies.

      • auth: RequestAuthInput | undefined

        The operation's current auth material, read live at swap time so auth changed through any other path survives the replay.

      • accessToken: string

        The fresh access token from the refresh grant.

      Returns RequestAuthInput

      The replacement RequestAuthInput.