File tree Expand file tree Collapse file tree
apps/sim/app/api/auth/instagram/authorize Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ export const GET = withRouteHandler(async (request: NextRequest) => {
2828 return NextResponse . json ( { error : 'Unauthorized' } , { status : 401 } )
2929 }
3030
31+ const clientId = env . INSTAGRAM_CLIENT_ID
32+ if ( ! clientId ) {
33+ logger . error ( 'INSTAGRAM_CLIENT_ID not configured' )
34+ return NextResponse . json ( { error : 'Instagram client ID not configured' } , { status : 500 } )
35+ }
36+
3137 const parsed = await parseRequest ( authorizeInstagramContract , request , { } )
3238 if ( ! parsed . success ) return parsed . response
3339 const { returnUrl, workspaceId } = parsed . data . query
@@ -44,12 +50,6 @@ export const GET = withRouteHandler(async (request: NextRequest) => {
4450 } )
4551 }
4652
47- const clientId = env . INSTAGRAM_CLIENT_ID
48- if ( ! clientId ) {
49- logger . error ( 'INSTAGRAM_CLIENT_ID not configured' )
50- return NextResponse . json ( { error : 'Instagram client ID not configured' } , { status : 500 } )
51- }
52-
5353 const baseUrl = getBaseUrl ( )
5454 const state = generateShortId ( 32 )
5555 const redirectUri = `${ baseUrl } /api/auth/oauth2/callback/instagram`
You can’t perform that action at this time.
0 commit comments