40105: Nonce value replayed

nonce_value_replayed

A token request was rejected because its nonce had already been used. Each nonce may be presented only once, so a repeated value is treated as a replayed request.

What you should do

Generate a fresh token request on every authentication rather than caching and reusing one. Each token request carries a nonce that Ably accepts only once, so your authCallback or auth endpoint must return a newly created request each time it is called. If an HTTP cache sits between the client and your endpoint, set cache-busting response headers such as Cache-Control: no-cache, no-store, must-revalidate so a stale request isn't replayed.

Why it happens

A token request was presented with a nonce that had already been used. Usually a token request is being cached and reused, whether by your auth server, your authCallback, or an HTTP cache between the client and your endpoint. It can also happen transiently on a network fault: if a request reaches Ably but its response doesn't reach the client, the client may retry the same request against a fallback endpoint, and the repeated nonce is rejected.

What you'll see

The error is reported with code 40105 and HTTP status 401. The message is Nonce value replayed.