Chess Now! IconChess Now
API ReferenceDevice auth

Start device auth

POST
/api/device/init

Initiates a device auth flow by generating a device code and user code.

It's not an OAuth 2.0 Device Authorization Grant, as this doesn't follow the format, but it's pretty similar to it.

Triggers the device_auth ws event once the user denies/accepts the device auth request (or it expires).

Request Body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/device/init" \  -H "Content-Type: application/json" \  -d '{    "scopes": [      "account"    ]  }'
{  "success": true,  "data": {    "deviceCode": "4krOEOckwOYmrnNLMC01HoHfIdDcIbRLpNXHtpUp",    "userCode": "AN23B5",    "verificationUri": "https://chessnow.angelcmh.com/device",    "verificationUriComplete": "https://chessnow.angelcmh.com/device?code=AN23B5",    "expiresIn": 300,    "interval": 5  }}