The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update route.ts
Steven Tey0c663f305fc3
diff --git a/apps/web/app/api/oauth/token/route.ts b/apps/web/app/api/oauth/token/route.tsindex f3002febd7..334de6371c 100644--- a/apps/web/app/api/oauth/token/route.ts+++ b/apps/web/app/api/oauth/token/route.ts@@ -10,6 +10,8 @@ const CORS_HEADERS = {"Access-Control-Allow-Headers": "Content-Type, Authorization",};+export const maxDuration = 30;+// POST /api/oauth/token - Exchange authorization code for access token and refresh access tokenexport async function POST(req: NextRequest) {try {@@ -17,14 +19,13 @@ export async function POST(req: NextRequest) {const validatedData = tokenGrantSchema.parse(formData);if (validatedData.grant_type === "authorization_code") {- return NextResponse.json(- await exchangeAuthCodeForToken(req, validatedData),- {- headers: CORS_HEADERS,- },- );+ const data = await exchangeAuthCodeForToken(req, validatedData);+ return NextResponse.json(data, {+ headers: CORS_HEADERS,+ });} else if (validatedData.grant_type === "refresh_token") {- return NextResponse.json(await refreshAccessToken(req, validatedData), {+ const data = await refreshAccessToken(req, validatedData);+ return NextResponse.json(data, {headers: CORS_HEADERS,});}