fix: using 'authMode' instead of 'authType' (#45626)

## What kind of change does this PR introduce?

docs update

## What is the current behavior?

Current docs using `authType`

## What is the new behavior?

Using new `authMode` syntax
This commit is contained in:
Kalleby Santos
2026-05-06 10:36:29 +01:00
committed by GitHub
parent 5065e3ae9f
commit bcf54b0eaa
+2 -2
View File
@@ -249,14 +249,14 @@ export default {
### Combining modes
Functions that answer both users and internal callers take an array on `auth`. Modes are tried in order. The first match wins, and `ctx.authType` tells you which matched.
Functions that answer both users and internal callers take an array on `auth`. Modes are tried in order. The first match wins, and `ctx.authMode` tells you which matched.
```ts
import { withSupabase } from 'npm:@supabase/server'
export default {
fetch: withSupabase({ auth: ['user', 'secret:automations'] }, async (req, ctx) => {
if (ctx.authType === 'user') {
if (ctx.authMode === 'user') {
// your business logic for user calls. ctx.supabase is scoped to them
return Response.json({ ok: true })
}