1
0
forked from baron/baron-sso

App 카드 로고 이미지 표시

This commit is contained in:
2026-04-09 11:27:46 +09:00
parent df09694ed6
commit 06a6875cdb
5 changed files with 290 additions and 31 deletions

View File

@@ -4602,6 +4602,48 @@ func (h *AuthHandler) ListLinkedRps(c *fiber.Ctx) error {
}
}
// Consent session payload may omit metadata fields such as logo_url.
// Rehydrate missing display fields from the full Hydra client object.
for clientID, record := range records {
if record == nil {
continue
}
needsHydraLookup := record.Logo == "" || record.URL == "" || record.InitURL == ""
if !needsHydraLookup {
continue
}
client, err := h.Hydra.GetClient(c.Context(), clientID)
if err != nil {
continue
}
if record.Name == "" {
name := strings.TrimSpace(client.ClientName)
if name == "" {
name = client.ClientID
}
record.Name = name
}
if record.Logo == "" {
record.Logo = extractHydraClientLogo(client.Metadata)
}
if record.URL == "" {
record.URL = resolveLinkedRPURL(
client.ClientID,
client.ClientURI,
client.RedirectURIs,
)
}
if record.InitURL == "" {
record.InitURL = resolveLinkedRPInitURL(
client.ClientID,
record.Scopes,
client.RedirectURIs,
)
}
}
// [New] DB에서 과거 동의 내역 가져와 병합 (비활성 RP 포함)
if h.ConsentRepo != nil {
for _, subject := range subjects {