Fix oidc2 and oidc3 logos (#564)

* chore: strip numbers form oidc providers

* chore: strip only trailing numbers

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
wolffshots
2025-09-19 15:21:17 +02:00
committed by GitHub
parent cf74a711e9
commit 149157604d

View File

@@ -12,7 +12,7 @@ export async function GET(event: RequestEvent) {
const r = await event.locals.pb.collection('users').listAuthMethods();
for (const provider of r.oauth2.providers) {
const imageURL = `${env.PUBLIC_POCKETBASE_URL}/_/images/oauth2/${provider.name}.svg`
const imageURL = `${env.PUBLIC_POCKETBASE_URL}/_/images/oauth2/${provider.name.replace(/\s*\(\d+\)$/, '')}.svg`
provider['img' as keyof typeof provider] = await imageUrlToBase64(imageURL, event.fetch);
provider['url' as keyof typeof provider] = `${provider.authURL}${redirectURL}`
}
@@ -59,4 +59,4 @@ async function imageUrlToBase64(url: string, f: (url: RequestInfo | URL, config?
console.error('Error fetching image:', error);
throw error;
}
}
}