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:
@@ -12,7 +12,7 @@ export async function GET(event: RequestEvent) {
|
|||||||
const r = await event.locals.pb.collection('users').listAuthMethods();
|
const r = await event.locals.pb.collection('users').listAuthMethods();
|
||||||
|
|
||||||
for (const provider of r.oauth2.providers) {
|
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['img' as keyof typeof provider] = await imageUrlToBase64(imageURL, event.fetch);
|
||||||
provider['url' as keyof typeof provider] = `${provider.authURL}${redirectURL}`
|
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);
|
console.error('Error fetching image:', error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user