mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
fix remaining anon key access
This commit is contained in:
1 parent
f32d6926ef
commit
514b8147cc
1 file changed
+6
-3
@@ -73,7 +73,10 @@ const DocView: FC<any> = observer(({}) => {
|
||||
projectRef,
|
||||
})
|
||||
|
||||
const apiKey = data?.autoApiService?.defaultApiKey
|
||||
const apiService = data?.autoApiService
|
||||
const anonKey = apiService?.service_api_keys.find((x) => x.name === 'anon key')
|
||||
? apiService.defaultApiKey
|
||||
: undefined
|
||||
const swaggerUrl = data?.autoApiService?.restUrl
|
||||
|
||||
const canReadServiceKey = checkPermissions(
|
||||
@@ -88,7 +91,7 @@ const DocView: FC<any> = observer(({}) => {
|
||||
} = useProjectJsonSchemaQuery({
|
||||
projectRef,
|
||||
swaggerUrl,
|
||||
apiKey,
|
||||
apiKey: anonKey,
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
@@ -172,7 +175,7 @@ const DocView: FC<any> = observer(({}) => {
|
||||
key="anon"
|
||||
onClick={() =>
|
||||
setShowApiKey({
|
||||
key: apiKey,
|
||||
key: anonKey,
|
||||
name: 'anon (public)',
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user