Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coinbase provider - CallbackRouteError #12433

Open
wilkinnovo opened this issue Dec 28, 2024 · 0 comments
Open

Coinbase provider - CallbackRouteError #12433

wilkinnovo opened this issue Dec 28, 2024 · 0 comments
Labels
bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@wilkinnovo
Copy link

Provider type

Coinbase

Environment

 System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 9.29 GB / 15.56 GB
  Binaries:
    Node: 22.12.0 - C:\Program Files\nodejs\node.EXE      
    Yarn: 1.22.22 - ~\.bun\bin\yarn.EXE
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
    bun: 1.1.42 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (131.0.2903.99)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    @auth/prisma-adapter: ^2.7.4 => 2.7.4
    next: 15.1.2 => 15.1.2
    next-auth: ^5.0.0-beta.25 => 5.0.0-beta.25
    react: ^19.0.0 => 19.0.0

Reproduction URL

https://github.com/wilkinnovo/auth-example

Describe the issue

Coinbase app API may have changed. It is not sending the correct content type in the response when sending request to https://api.coinbase.com/v2/user . Content-Type appears to be: 'content-type': 'application/protobuf'. making the call to .json() give error as follows:  

[auth][error] CallbackRouteError: Read more at https://errors.authjs.dev#callbackrouteerror
[auth][cause]: SyntaxError: Unexpected token '�', "

$a851b4"... is not valid JSON
at JSON.parse ()
at parseJSONFromBytes (node:internal/deps/undici/undici:5731:19)
at successSteps (node:internal/deps/undici/undici:5712:27)
at fullyReadBody (node:internal/deps/undici/undici:4609:9)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async consumeBody (node:internal/deps/undici/undici:5721:7)
.....

error_auth5

How to reproduce

Clone the repo and run the application with the credentials from coinbase and prisma DB url string.

Expected behavior

Respond with JSON data as follows:

curl https://api.coinbase.com/v2/user /
-H 'Authorization: Bearer 6915ab99857fec1e6f2f6c078583756d0c09d7207750baea28dfbc3d4b0f2cb80'

Example response:

{
"data": {
"id": "9da7a204-544e-5fd1-9a12-61176c5d4cd8",
"name": "User One",
"username": "user1",
"profile_location": null,
"profile_bio": null,
"profile_url": "https://coinbase.com/user1",
"avatar_url": "https://images.coinbase.com/avatar?h=vR%2FY8igBoPwuwGren5JMwvDNGpURAY%2F0nRIOgH%2FY2Qh%2BQ6nomR3qusA%2Bh6o2%0Af9rH&s=128",
"resource": "user",
"resource_path": "/v2/user"
}
}

@wilkinnovo wilkinnovo added bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

1 participant