File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
apps/sim/app/api/tools/drive Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import { createLogger } from '@sim/logger'
22import { type NextRequest , NextResponse } from 'next/server'
33import { authorizeCredentialUse } from '@/lib/auth/credential-access'
4- import { checkInternalAuth } from '@/lib/auth/hybrid'
4+ import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
55import { validateAlphanumericId } from '@/lib/core/security/input-validation'
66import { generateRequestId } from '@/lib/core/utils/request'
77import { refreshAccessTokenIfNeeded } from '@/app/api/auth/oauth/utils'
@@ -16,7 +16,7 @@ export async function GET(request: NextRequest) {
1616 const requestId = generateRequestId ( )
1717 logger . info ( `[${ requestId } ] Google Drive file request received` )
1818
19- const auth = await checkInternalAuth ( request )
19+ const auth = await checkSessionOrInternalAuth ( request )
2020 if ( ! auth . success || ! auth . userId ) {
2121 return NextResponse . json ( { error : auth . error || 'Unauthorized' } , { status : 401 } )
2222 }
Original file line number Diff line number Diff line change 11import { createLogger } from '@sim/logger'
22import { type NextRequest , NextResponse } from 'next/server'
33import { authorizeCredentialUse } from '@/lib/auth/credential-access'
4- import { checkInternalAuth } from '@/lib/auth/hybrid'
4+ import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
55import { validateAlphanumericId } from '@/lib/core/security/input-validation'
66import { generateRequestId } from '@/lib/core/utils/request'
77import { refreshAccessTokenIfNeeded } from '@/app/api/auth/oauth/utils'
@@ -73,7 +73,7 @@ export async function GET(request: NextRequest) {
7373 const requestId = generateRequestId ( )
7474 logger . info ( `[${ requestId } ] Google Drive files request received` )
7575
76- const auth = await checkInternalAuth ( request )
76+ const auth = await checkSessionOrInternalAuth ( request )
7777 if ( ! auth . success || ! auth . userId ) {
7878 return NextResponse . json ( { error : auth . error || 'Unauthorized' } , { status : 401 } )
7979 }
You can’t perform that action at this time.
0 commit comments