File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
apps/sim/app/api/providers/fireworks/models Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { type NextRequest, NextResponse } from 'next/server'
33import { getBYOKKey } from '@/lib/api-key/byok'
44import { getSession } from '@/lib/auth'
55import { env } from '@/lib/core/config/env'
6+ import { getUserEntityPermissions } from '@/lib/workspaces/permissions/utils'
67import { filterBlacklistedModels , isProviderBlacklisted } from '@/providers/utils'
78
89const logger = createLogger ( 'FireworksModelsAPI' )
@@ -31,9 +32,12 @@ export async function GET(request: NextRequest) {
3132 if ( workspaceId ) {
3233 const session = await getSession ( )
3334 if ( session ?. user ?. id ) {
34- const byokResult = await getBYOKKey ( workspaceId , 'fireworks' )
35- if ( byokResult ) {
36- apiKey = byokResult . apiKey
35+ const permission = await getUserEntityPermissions ( session . user . id , 'workspace' , workspaceId )
36+ if ( permission ) {
37+ const byokResult = await getBYOKKey ( workspaceId , 'fireworks' )
38+ if ( byokResult ) {
39+ apiKey = byokResult . apiKey
40+ }
3741 }
3842 }
3943 }
@@ -53,7 +57,7 @@ export async function GET(request: NextRequest) {
5357 Authorization : `Bearer ${ apiKey } ` ,
5458 'Content-Type' : 'application/json' ,
5559 } ,
56- next : { revalidate : 300 } ,
60+ cache : 'no-store' ,
5761 } )
5862
5963 if ( ! response . ok ) {
You can’t perform that action at this time.
0 commit comments