From 8a82f392ca762bf9eb72554e9337109b8f4d3599 Mon Sep 17 00:00:00 2001 From: syui Date: Thu, 19 Jun 2025 18:05:00 +0900 Subject: [PATCH] fix getprofile --- my-blog/static/css/style.css | 3 ++- oauth/src/api/atproto.js | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/my-blog/static/css/style.css b/my-blog/static/css/style.css index 57ebe96..972f0b6 100644 --- a/my-blog/static/css/style.css +++ b/my-blog/static/css/style.css @@ -664,7 +664,8 @@ article.article-content { .chat-message.comment-style { background: #ffffff; border: 1px solid #d1d9e0; - border-radius: 8px; + border-left: 4px solid var(--theme-color); + border-radius: 8px; padding: 16px; margin-bottom: 12px; } diff --git a/oauth/src/api/atproto.js b/oauth/src/api/atproto.js index 5c3480c..af6ddbb 100644 --- a/oauth/src/api/atproto.js +++ b/oauth/src/api/atproto.js @@ -65,7 +65,7 @@ export const atproto = { async getProfile(bsky, actor) { // Skip test DIDs if (actor && actor.includes('test-')) { - logger.log('Skipping profile fetch for test DID:', actor) + console.log('Skipping profile fetch for test DID:', actor) return { did: actor, handle: 'test.user', @@ -74,7 +74,17 @@ export const atproto = { } } - return await request(`${bsky}/xrpc/${ENDPOINTS.getProfile}?actor=${actor}`) + // Check if endpoint supports getProfile + let apiEndpoint = bsky + + // Allow public.api.bsky.app and bsky.syu.is, redirect other PDS endpoints + if (!bsky.includes('public.api.bsky.app') && !bsky.includes('bsky.syu.is')) { + // If it's a PDS endpoint that doesn't support getProfile, redirect to public API + console.warn(`getProfile called with PDS endpoint ${bsky}, redirecting to public API`) + apiEndpoint = 'https://public.api.bsky.app' + } + + return await request(`${apiEndpoint}/xrpc/${ENDPOINTS.getProfile}?actor=${actor}`) }, async getRecords(pds, repo, collection, limit = 10) {