Skip to content

Commit 2a673c7

Browse files
committed
[DOC] Add missing parameter in NextJs
Official supabase document describes to add Authorization token. [document](https://supabase.com/docs/guides/api/quickstart) It's impossible to update rows without this token when rls is set.
1 parent 272ea5f commit 2a673c7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/NextJs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ async function handler(request: Request) {
212212
request.headers.get('content-type') ?? 'application/json',
213213
// supabase authentication
214214
apiKey: process.env.SUPABASE_SERVICE_ROLE ?? '',
215+
Authorization: "Bearer " + process.env.SUPABASE_SERVICE_ROLE ?? '',
215216
},
216217
};
217218

@@ -260,6 +261,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
260261
["content-type"]: req.headers["content-type"] ?? "application/json",
261262
// supabase authentication
262263
apiKey: process.env.SUPABASE_SERVICE_ROLE ?? '',
264+
Authorization: "Bearer " + process.env.SUPABASE_SERVICE_ROLE ?? '',
263265
},
264266
};
265267
if (req.body) {

0 commit comments

Comments
 (0)