Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

477 B
Raw Blame
import { and, eq } from "drizzle-orm";
import db, { schema } from "../../database";

async function getIdToken(userId: string) {
  const [account] = await db
    .select({ idToken: schema.accountTable.idToken })
    .from(schema.accountTable)
    .where(
      and(
        eq(schema.accountTable.userId, userId),
        eq(schema.accountTable.providerId, "custom"),
      ),
    )
    .limit(1);

  return { idToken: account?.idToken ?? null };
}

export default getIdToken;