diff --git a/src/app/api/github/blob/[owner]/[repository]/[...path]/route.ts b/src/app/api/github/blob/[owner]/[repository]/[...path]/route.ts index e09c5d3c..9c8b595c 100644 --- a/src/app/api/github/blob/[owner]/[repository]/[...path]/route.ts +++ b/src/app/api/github/blob/[owner]/[repository]/[...path]/route.ts @@ -1,5 +1,5 @@ import { NextRequest, NextResponse } from "next/server" -import { gitHubClient } from "@/composition" +import { userGitHubClient } from "@/composition" interface GetBlobParams { owner: string @@ -9,7 +9,7 @@ interface GetBlobParams { export async function GET(req: NextRequest, { params }: { params: GetBlobParams }) { const path = params.path.join("/") - const item = await gitHubClient.getRepositoryContent({ + const item = await userGitHubClient.getRepositoryContent({ repositoryOwner: params.owner, repositoryName: params.repository, path: path, diff --git a/src/composition.ts b/src/composition.ts index 3b37f929..b0fc8bc5 100644 --- a/src/composition.ts +++ b/src/composition.ts @@ -82,7 +82,7 @@ export const gitHubClient = new GitHubClient({ accessTokenReader: accessTokenService }) -const userGitHubClient = new AccessTokenRefreshingGitHubClient( +export const userGitHubClient = new AccessTokenRefreshingGitHubClient( accessTokenService, gitHubClient )