mirror of
https://github.com/supabase/supabase.git
synced 2026-05-06 08:56:46 -04:00
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:
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user