# CLI_DEVICE_TOKEN_EXCHANGE_FAILED

- Surface: CLI
- Exit code: 2

## Cause

The device code was approved but exchanging it for a token failed, or the token response carried no `user_id` to identify the session.

## Fix

Restart `splitch login` and complete the new device authorization. If it repeats, the auth service is returning a bad token response.

## Related

- [CLI_DEVICE_AUTHORIZATION_FAILED](https://splitch.dev/docs/error/CLI_DEVICE_AUTHORIZATION_FAILED)
- [CLI_DEVICE_APPROVAL_TIMEOUT](https://splitch.dev/docs/error/CLI_DEVICE_APPROVAL_TIMEOUT)

Source: https://splitch.dev/docs/error/CLI_DEVICE_TOKEN_EXCHANGE_FAILED