Unverified 提交 4fb4e49c authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Supabase publishable key (#73)

上级 e488df24
...@@ -7,7 +7,10 @@ async function getPublishableKey({ projectId }: { projectId: string }) { ...@@ -7,7 +7,10 @@ async function getPublishableKey({ projectId }: { projectId: string }) {
if (!keys) { if (!keys) {
throw new Error("No keys found for project"); throw new Error("No keys found for project");
} }
const publishableKey = keys.find((key) => (key as any)["name"] === "anon"); const publishableKey = keys.find(
(key) =>
(key as any)["name"] === "anon" || (key as any)["type"] === "publishable"
);
if (!publishableKey) { if (!publishableKey) {
throw new Error("No publishable key found for project"); throw new Error("No publishable key found for project");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论