Barrel Of LubeB
Convex Community7mo ago
65 replies
Barrel Of Lube

[Better Auth] auth.api.getAccessToken returns Uncaught APIError: Account not found

I have tried the following
using google oauth
export const getAuthToken = query({
  args: {
    providerId: v.string(),
  },
  handler: async (ctx, args) => {
    const { userId } = await requireAuth(ctx);
    const auth = createAuth(ctx);
    const token = await auth.api.getAccessToken({
      body: {
        providerId: args.providerId,
        userId,
      },
    });
    console.log(token)
    return token;
  },
});


I have also tried using the betterauthcomponent and get the header and pass it along it returns Uncaught APIError: Failed to get a valid access token
@erquhart
Was this page helpful?