···1"use server";
23import { IdResolver } from "@atproto/identity";
4-import { createServerClient } from "@supabase/ssr";
5import { cookies } from "next/headers";
6-import { Database } from "supabase/database.types";
78-let supabase = createServerClient<Database>(
9- process.env.NEXT_PUBLIC_SUPABASE_API_URL as string,
10- process.env.SUPABASE_SERVICE_ROLE_KEY as string,
11- { cookies: {} },
12-);
13let idResolver = new IdResolver();
14export async function getIdentityData() {
15 let cookieStore = await cookies();
16 let auth_token = cookieStore.get("auth_token")?.value;
17 let auth_res = auth_token
18- ? await supabase
19 .from("email_auth_tokens")
20 .select(
21 `*,
···34 if (!auth_res?.data?.identities) return null;
35 if (auth_res.data.identities.atp_did) {
36 //I should create a relationship table so I can do this in the above query
37- let { data: publications } = await supabase
38 .from("publications")
39 .select("*")
40 .eq("identity_did", auth_res.data.identities.atp_did);
···1"use server";
23import { IdResolver } from "@atproto/identity";
04import { cookies } from "next/headers";
5+import { supabaseServerClient } from "supabase/serverClient";
6000007let idResolver = new IdResolver();
8export async function getIdentityData() {
9 let cookieStore = await cookies();
10 let auth_token = cookieStore.get("auth_token")?.value;
11 let auth_res = auth_token
12+ ? await supabaseServerClient
13 .from("email_auth_tokens")
14 .select(
15 `*,
···28 if (!auth_res?.data?.identities) return null;
29 if (auth_res.data.identities.atp_did) {
30 //I should create a relationship table so I can do this in the above query
31+ let { data: publications } = await supabaseServerClient
32 .from("publications")
33 .select("*")
34 .eq("identity_did", auth_res.data.identities.atp_did);