---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [clients](../index.md) / redactAccessTokens

# Function: redactAccessTokens()

> **redactAccessTokens**(`text`): `string`

Defined in: [packages/b2c-tooling-sdk/src/clients/error-utils.ts:190](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/b7ec7d4a1464ef7bbb6a5757ffd6f99a18a31bf6/packages/b2c-tooling-sdk/src/clients/error-utils.ts#L190)

Replaces access tokens in text with `REDACTED`. Some API faults echo the
request's token (OCAPI: "The access token '...' is invalid"), so messages
built from response bodies pass through this before they reach users,
logs, or telemetry.

## Parameters

### text

`string`

## Returns

`string`
