Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs: Supabase edge functions 401 troubleshooting (#43475)

TheOtherBrian11de7b9e23b4f
diff --git a/apps/docs/content/troubleshooting/edge-function-401-error-response.mdx b/apps/docs/content/troubleshooting/edge-function-401-error-response.mdx
index b0aadb87cda..c48057cfbd9 100644
--- a/apps/docs/content/troubleshooting/edge-function-401-error-response.mdx
+++ b/apps/docs/content/troubleshooting/edge-function-401-error-response.mdx
@@ -18,7 +18,7 @@ By default, edge functions are configured to check requests for a valid [legacy
#### How the check causes 401 errors
-The check will fail and return a 401 permission error if:
+The check fails and return a 401 permission error if:
- The request includes an invalid legacy key, or
- The request uses the newer asymmetric keys instead of a legacy key.
@@ -43,7 +43,7 @@ If the tests return a 401 but don't match the criteria below, the error is comin
### Inspecting the return message
-When an edge function fails due to a platform 401 error, it will return the error:
+When an edge function fails due to a platform 401 error, it returns the error:
```json
{
@@ -67,7 +67,7 @@ A 401 status code alone doesn't confirm a JWT check failure by itself. The log m
![image](/docs/img/troubleshooting/401_in_the_logs.png)
-Instead of manually reviewing the logs, you can run the below query in the [log explorer](</dashboard/project/_/logs/explorer?q=SELECT+DISTINCT%0A++++req.pathname+AS+function_name,%0A++++res.status_code%0A++FROM+function_edge_logs%0A++CROSS+JOIN+UNNEST(metadata)+AS+metadata+%0A++CROSS+JOIN+UNNEST(metadata.request)+AS+req+%0A++CROSS+JOIN+UNNEST(metadata.response)+AS+res+%0AWHERE+status_code+=+401+AND+metadata.execution_id+IS+NULL%0ALIMIT+10;&its=&ite=>) to get a list of functions that were impacted by the check:
+Instead of manually reviewing the logs, you can run the below query in the [log explorer](</dashboard/project/_/logs/explorer?q=SELECT+DISTINCT%0A++++req.pathname+AS+function_name,%0A++++res.status_code%0A++FROM+function_edge_logs%0A++CROSS+JOIN+UNNEST(metadata)+AS+metadata+%0A++CROSS+JOIN+UNNEST(metadata.request)+AS+req+%0A++CROSS+JOIN+UNNEST(metadata.response)+AS+res+%0AWHERE+status_code+=+401+AND+metadata.execution_id+IS+NULL%0ALIMIT+10;&its=&ite=%3E>) to get a list of functions that were impacted by the check:
```sql
select distinct
@@ -143,7 +143,7 @@ With the [Supabase CLI](/docs/guides/local-development/cli/getting-started), you
```sh
supabase functions deploy hello-world --no-verify-jwt
-````
+```
</AccordionItem>
@@ -158,3 +158,4 @@ If you would like to continue using the JWT check, make sure that your [Supabase
- [Debugging Edge Functions](/docs/guides/functions/logging)
- [Quickstart Deployment: Dashboard](/docs/guides/functions/quickstart-dashboard)
- [Quickstart Deployment: CLI](/docs/guides/functions/quickstart)
+````