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

chore(platforms): using new coinbase oauth endpoints #3204

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions platforms/src/Coinbase/App-Bindings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,27 @@ export class CoinbasePlatform extends Platform {
</Hyperlink>
<br />
<br />
Obtain the Coinbase Stamp by completing the following 2 steps to prove your Coinbase Verified ID and Coinbase account:
Obtain the Coinbase Stamp by completing the following 2 steps to prove your Coinbase Verified ID and Coinbase
account:
<br />
<br />
<strong>Step 1:</strong> <Hyperlink href="https://www.coinbase.com/onchain-verify">Verify your Coinbase ID</Hyperlink> with the same address that you&apos;re currently using with this Passport.
<strong>Step 1:</strong>{" "}
<Hyperlink href="https://www.coinbase.com/onchain-verify">Verify your Coinbase ID</Hyperlink> with the same
address that you&apos;re currently using with this Passport.
<br />
<br />
<strong>Step 2:</strong> Click &quot;Verify&quot; below to sign into your Coinbase account.
<br />
<br />
Important considerations:
<ul>
<li>You <em>must</em> complete both steps to verify this Stamp.</li>
<li>You <em>must</em> have an active Coinbase account with a verified government ID to mint your onchain attestation for free on Base.</li>
<li>
You <em>must</em> complete both steps to verify this Stamp.
</li>
<li>
You <em>must</em> have an active Coinbase account with a verified government ID to mint your onchain
attestation for free on Base.
</li>
</ul>
</div>
),
Expand Down Expand Up @@ -68,9 +76,9 @@ export class CoinbasePlatform extends Platform {
}

async getOAuthUrl(state: string): Promise<string> {
const coinbasebUrl = await Promise.resolve(
`https://www.coinbase.com/oauth/authorize?response_type=code&client_id=${this.clientId}&redirect_uri=${this.redirectUri}&state=${state}`
const coinbaseUrl = await Promise.resolve(
`https://login.coinbase.com/oauth2/auth?response_type=code&client_id=${this.clientId}&redirect_uri=${this.redirectUri}&state=${state}`
);
return coinbasebUrl;
return coinbaseUrl;
}
}
2 changes: 1 addition & 1 deletion platforms/src/Coinbase/Providers/coinbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const requestAccessToken = async (code: string): Promise<string | undefin
params.append("redirect_uri", callback);

// Exchange the code for an access token
tokenRequest = await axios.post("https://api.coinbase.com/oauth/token", params.toString(), {
tokenRequest = await axios.post("https://login.coinbase.com/oauth2/token", params.toString(), {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Accept: "application/json",
Expand Down
10 changes: 5 additions & 5 deletions platforms/src/Coinbase/__tests__/coinbase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe("Attempt verification", function () {
);
expect(mockedAxios.post).toBeCalledTimes(1);
expect(mockedAxios.post).toBeCalledWith(
"https://api.coinbase.com/oauth/token",
"https://login.coinbase.com/oauth2/token",
`grant_type=authorization_code&client_id=${clientId}&client_secret=${clientSecret}&code=${code}&redirect_uri=${callback}`,
{ headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" } }
);
Expand Down Expand Up @@ -190,7 +190,7 @@ describe("Attempt verification", function () {
expect(mockedAxios.post).toBeCalledTimes(1);
// Check the request to get the token
expect(mockedAxios.post).toBeCalledWith(
"https://api.coinbase.com/oauth/token",
"https://login.coinbase.com/oauth2/token",
`grant_type=authorization_code&client_id=${clientId}&client_secret=${clientSecret}&code=${code}&redirect_uri=${callback}`,
{ headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" } }
);
Expand Down Expand Up @@ -229,7 +229,7 @@ describe("Attempt verification", function () {

// Check the request to get the token
expect(mockedAxios.post).toBeCalledWith(
"https://api.coinbase.com/oauth/token",
"https://login.coinbase.com/oauth2/token",
`grant_type=authorization_code&client_id=${clientId}&client_secret=${clientSecret}&code=${code}&redirect_uri=${callback}`,
{ headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" } }
);
Expand Down Expand Up @@ -260,7 +260,7 @@ describe("Attempt verification", function () {

// Check the request to get the token
expect(mockedAxios.post).toBeCalledWith(
"https://api.coinbase.com/oauth/token",
"https://login.coinbase.com/oauth2/token",
`grant_type=authorization_code&client_id=${clientId}&client_secret=${clientSecret}&code=${code}&redirect_uri=${callback}`,
{ headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" } }
);
Expand Down Expand Up @@ -289,7 +289,7 @@ describe("Attempt verification", function () {
expect(mockedAxios.post).toBeCalledTimes(1);
// Check the request to get the token
expect(mockedAxios.post).toBeCalledWith(
"https://api.coinbase.com/oauth/token",
"https://login.coinbase.com/oauth2/token",
`grant_type=authorization_code&client_id=${clientId}&client_secret=${clientSecret}&code=${code}&redirect_uri=${callback}`,
{ headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" } }
);
Expand Down
Loading
Loading