forked from baron/baron-sso
App 카드 로고 이미지 표시
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user