`/auth/token` endpoint returns "Invalid code"

I amm using home-assistant-js-websocket package’s getAuth to get my code.

After logging in and redirected back to my app, the request for getting the token returns a bad request error, with message “Invalid code”

url code parameter on redirect back

token request payload and response

image