mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 15:51:13 -05:00
Fix old URL generation
This commit is contained in:
@@ -8,17 +8,15 @@ const corsHeaders = {
|
||||
};
|
||||
|
||||
const CLOUDFLARE_ACCOUNT_ID = Deno.env.get('CLOUDFLARE_ACCOUNT_ID');
|
||||
const CLOUDFLARE_ACCOUNT_HASH = Deno.env.get('CLOUDFLARE_ACCOUNT_HASH');
|
||||
const CLOUDFLARE_API_TOKEN = Deno.env.get('CLOUDFLARE_IMAGES_API_TOKEN');
|
||||
|
||||
// Validate configuration at startup
|
||||
if (!CLOUDFLARE_ACCOUNT_ID || !CLOUDFLARE_ACCOUNT_HASH || !CLOUDFLARE_API_TOKEN) {
|
||||
if (!CLOUDFLARE_ACCOUNT_ID || !CLOUDFLARE_API_TOKEN) {
|
||||
console.error('[OAuth Profile] Missing Cloudflare configuration:', {
|
||||
hasAccountId: !!CLOUDFLARE_ACCOUNT_ID,
|
||||
hasAccountHash: !!CLOUDFLARE_ACCOUNT_HASH,
|
||||
hasApiToken: !!CLOUDFLARE_API_TOKEN,
|
||||
});
|
||||
console.error('[OAuth Profile] Please configure CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_ACCOUNT_HASH, and CLOUDFLARE_IMAGES_API_TOKEN in Supabase Edge Function secrets');
|
||||
console.error('[OAuth Profile] Please configure CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_IMAGES_API_TOKEN in Supabase Edge Function secrets');
|
||||
}
|
||||
|
||||
interface GoogleUserMetadata {
|
||||
@@ -204,11 +202,10 @@ Deno.serve(async (req) => {
|
||||
// Download and upload avatar to Cloudflare
|
||||
if (avatarUrl) {
|
||||
// Validate secrets before attempting upload
|
||||
if (!CLOUDFLARE_ACCOUNT_ID || !CLOUDFLARE_ACCOUNT_HASH || !CLOUDFLARE_API_TOKEN) {
|
||||
if (!CLOUDFLARE_ACCOUNT_ID || !CLOUDFLARE_API_TOKEN) {
|
||||
console.warn('[OAuth Profile] Cloudflare secrets not configured, skipping avatar upload');
|
||||
console.warn('[OAuth Profile] Missing:', {
|
||||
accountId: !CLOUDFLARE_ACCOUNT_ID,
|
||||
accountHash: !CLOUDFLARE_ACCOUNT_HASH,
|
||||
apiToken: !CLOUDFLARE_API_TOKEN,
|
||||
});
|
||||
} else {
|
||||
@@ -287,7 +284,6 @@ Deno.serve(async (req) => {
|
||||
error: error.message,
|
||||
provider: provider,
|
||||
accountId: CLOUDFLARE_ACCOUNT_ID,
|
||||
accountHash: CLOUDFLARE_ACCOUNT_HASH,
|
||||
hasToken: !!CLOUDFLARE_API_TOKEN,
|
||||
avatarUrl,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user