my own indieAuth provider! indiko.dunkirk.sh/docs
indieauth oauth2-server

fix: handle both URL and prefixed client IDs in consent screen

- Check if client ID starts with ikc_ prefix
- For custom apps, use name from DB or client ID
- For anonymous apps, parse URL and show hostname
- Only show app URL if it's a URL-based client ID

dunkirk.sh be1517bb 08616fcf

verified
+20 -2
+20 -2
src/routes/indieauth.ts
··· 421 421 .query("SELECT name, logo_url, description FROM apps WHERE client_id = ?") 422 422 .get(clientId) as { name: string | null; logo_url: string | null; description: string | null } | undefined; 423 423 424 - const appName = appData?.name || new URL(clientId).hostname; 424 + // Determine app name and URL - custom apps have ikc_ prefix and should use name from DB 425 + let appName: string; 426 + let appUrl: string | null = null; 427 + 428 + if (clientId.startsWith('ikc_')) { 429 + // Custom app with generated ID 430 + appName = appData?.name || clientId; 431 + } else { 432 + // URL-based client ID (anonymous app) 433 + try { 434 + const parsedUrl = new URL(clientId); 435 + appName = appData?.name || parsedUrl.hostname; 436 + appUrl = parsedUrl.hostname; 437 + } catch { 438 + // Fallback if URL parsing fails 439 + appName = appData?.name || clientId; 440 + } 441 + } 442 + 425 443 const appLogo = appData?.logo_url; 426 444 const appDescription = appData?.description; 427 445 ··· 666 684 </div> 667 685 <div class="app-info"> 668 686 <div class="app-name">${appName}</div> 669 - <div class="app-url">${new URL(clientId).hostname}</div> 687 + ${appUrl ? `<div class="app-url">${appUrl}</div>` : ''} 670 688 ${appDescription ? `<div class="app-description">${appDescription}</div>` : ''} 671 689 </div> 672 690 </div>