From f65a6889a1be31e6478e24570268e1bb3fb298be Mon Sep 17 00:00:00 2001 From: Stijnus <72551117+Stijnus@users.noreply.github.com> Date: Sat, 30 Aug 2025 12:05:17 +0200 Subject: [PATCH] Fix GitHub template authentication issue - Add fallback support for VITE_GITHUB_ACCESS_TOKEN environment variable - Fix 403 Forbidden error when fetching GitHub templates - Improve authentication compatibility for different token naming conventions - Ensure all GitHub-based templates work properly --- app/routes/api.github-template.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/routes/api.github-template.ts b/app/routes/api.github-template.ts index 8f1679d..4036a7c 100644 --- a/app/routes/api.github-template.ts +++ b/app/routes/api.github-template.ts @@ -211,7 +211,8 @@ export async function loader({ request, context }: { request: Request; context: try { // Access environment variables from Cloudflare context or process.env - const githubToken = context?.cloudflare?.env?.GITHUB_TOKEN || process.env.GITHUB_TOKEN; + const githubToken = + context?.cloudflare?.env?.GITHUB_TOKEN || process.env.GITHUB_TOKEN || process.env.VITE_GITHUB_ACCESS_TOKEN; let fileList;