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
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user