diff --git a/web/src/routes/api/v1/auth/oauth/+server.ts b/web/src/routes/api/v1/auth/oauth/+server.ts index 34436786..355c1cde 100644 --- a/web/src/routes/api/v1/auth/oauth/+server.ts +++ b/web/src/routes/api/v1/auth/oauth/+server.ts @@ -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; } -} \ No newline at end of file +}