MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / linkAccount

Function linkAccount

packages/web/src/lib/encryptedPrismaAdapter.ts:30–45  ·  view source on GitHub ↗
(account: AdapterAccount)

Source from the content-addressed store, hash-verified

28 return {
29 ...baseAdapter,
30 async linkAccount(account: AdapterAccount) {
31 const idpConfig = await getIdentityProviderConfig(account.provider);
32 if (!idpConfig) {
33 throw new Error(`Failed to link account for user id ${account.userId}. No provider config found for account with type ${account.provider}`);
34 }
35
36 const { provider, ...rest } = encryptAccountTokens(account);
37 await prisma.account.create({
38 data: {
39 ...rest,
40 providerId: provider,
41 providerType: idpConfig.provider,
42 },
43 });
44 return account;
45 },
46 async getUserByAccount({ provider, providerAccountId }) {
47 const account = await prisma.account.findUnique({
48 where: {

Callers

nothing calls this directly

Calls 2

encryptAccountTokensFunction · 0.85

Tested by

no test coverage detected