Skip to content

Commit

Permalink
Merge pull request #3 from ildecimo/develop
Browse files Browse the repository at this point in the history
vercel auth log issue
  • Loading branch information
maxdyy committed Aug 9, 2023
2 parents 96c8fb7 + 701cf75 commit a0d5d90
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/app/api/app/auth/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ export async function GET(req: NextRequest) {
return new NextResponse('Invalid query parameters', { status: 400 });
}

console.log({
client_id: env.CLIENT_ID,
client_secret: env.CLIENT_SECRET,
code: parsedParams.data.code,
context: parsedParams.data.context,
scope: parsedParams.data.scope,
grant_type: 'authorization_code',
redirect_uri: env.AUTH_CALLBACK,
});

const oauthResponse = await fetch(`${BIGCOMMERCE_LOGIN_URL}/oauth2/token`, {
method: 'POST',
headers: {
Expand All @@ -54,6 +64,10 @@ export async function GET(req: NextRequest) {
await oauthResponse.json()
);

console.log('------------------------------------');
console.log(parsedOAuthResponse);
console.log('------------------------------------');

if (!parsedOAuthResponse.success) {
return new NextResponse('Invalid access token response', { status: 500 });
}
Expand Down

0 comments on commit a0d5d90

Please sign in to comment.