mirror of
https://github.com/supabase/supabase.git
synced 2026-06-01 02:14:43 +08:00
fix: move docs off deprecated endpoint (#34490)
Docs is using a deprecated endpoint to get the API keys for the project variables component. Move to a new endpoint.
This commit is contained in:
@@ -283,11 +283,9 @@ function VariableView({ variable, className }: { variable: Variable; className?:
|
||||
function isInvalid(apiData: ProjectApiData) {
|
||||
switch (variable) {
|
||||
case 'url':
|
||||
return !apiData.autoApiService.endpoint
|
||||
return !apiData.app_config?.endpoint
|
||||
case 'anonKey':
|
||||
// If the anon key is not available, the backend may return the string:
|
||||
// You're using an older version of Supabase. Create a new project for the latest Auth features.
|
||||
return /older version/.test(apiData.autoApiService.defaultApiKey)
|
||||
return !apiData.service_api_keys?.some((key) => key.tags === 'anon')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,12 +305,10 @@ function VariableView({ variable, className }: { variable: Variable; className?:
|
||||
if (stateSummary === 'loggedIn.selectedProject.dataSuccess') {
|
||||
switch (variable) {
|
||||
case 'url':
|
||||
variableValue = `${apiData.autoApiService.protocol || 'https'}://${
|
||||
apiData.autoApiService.endpoint
|
||||
}`
|
||||
variableValue = `https://${apiData.app_config!.endpoint}`
|
||||
break
|
||||
case 'anonKey':
|
||||
variableValue = apiData.autoApiService.defaultApiKey
|
||||
variableValue = apiData.service_api_keys!.find((key) => key.tags === 'anon')!.api_key
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user