Skip to content

Commit c414c42

Browse files
committed
fix: resolve TypeScript compilation errors in OAuth diagnostic endpoints
- Add 'any' type annotation to diagnostics objects to fix property access errors - Fix async headers() call in Next.js 15 by adding await - These fixes allow successful TypeScript compilation for Vercel deployment
1 parent c89ea26 commit c414c42

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/app/api/auth/check-oauth-flow/route.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export async function GET(request: Request) {
44
const { searchParams } = new URL(request.url);
55
const provider = searchParams.get('provider') || 'google';
66

7-
const diagnostics = {
7+
const diagnostics: any = {
88
timestamp: new Date().toISOString(),
99
provider,
1010

@@ -14,6 +14,9 @@ export async function GET(request: Request) {
1414
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
1515
VERCEL_URL: process.env.VERCEL_URL,
1616
hasSecret: !!process.env.NEXTAUTH_SECRET,
17+
envModuleLoaded: false,
18+
envValues: null,
19+
envError: null,
1720
},
1821

1922
// Provider credentials check

src/app/api/auth/diagnose-env-validation/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NextResponse } from 'next/server';
22

33
export async function GET() {
4-
const diagnostics = {
4+
const diagnostics: any = {
55
timestamp: new Date().toISOString(),
66

77
// Raw process.env values

src/app/api/auth/test-oauth-flow/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { headers } from 'next/headers';
44
// Test OAuth flow and check for configuration errors
55
export async function GET() {
66
try {
7-
const headersList = headers();
7+
const headersList = await headers();
88
const host = headersList.get('host') || 'localhost:3000';
99
const protocol = headersList.get('x-forwarded-proto') || 'http';
1010
const baseUrl = `${protocol}://${host}`;

0 commit comments

Comments
 (0)