Replace portal title with entity name

Store a short entity name instead of the full home
heading so orgs can brand portals for sub-entities.
Restore hero i18n composition and keep the English
document title composed from the entity name.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-07-21 19:06:55 +02:00
parent 0fe814cfe4
commit 0d832508c9
46 changed files with 148 additions and 97 deletions

View File

@@ -85,7 +85,7 @@ func BuildClientMetadataDocument(
doc := oauth2.ClientMetadataDocument{
ClientID: clientID,
ClientName: portal.Title,
ClientName: "Compliance at " + portal.EntityName + ".",
ClientURI: portalRootURL,
RedirectURIs: []string{redirectURI},
TokenEndpointAuthMethod: "none",

View File

@@ -66,7 +66,7 @@ func TestBuildClientMetadataDocument(t *testing.T) {
websiteURL := "https://www.acme.com"
portal := &coredata.CompliancePortal{
Title: "Acme Compliance Page",
EntityName: "Acme",
WebsiteURL: &websiteURL,
}
@@ -76,7 +76,7 @@ func TestBuildClientMetadataDocument(t *testing.T) {
)
require.NoError(t, err)
assert.Equal(t, "https://acme.example.com/.well-known/oauth-client-metadata", doc.ClientID)
assert.Equal(t, "Acme Compliance Page", doc.ClientName)
assert.Equal(t, "Compliance at Acme.", doc.ClientName)
assert.Equal(t, []string{"https://acme.example.com/callback"}, doc.RedirectURIs)
assert.Equal(t, "https://acme.example.com", doc.ClientURI)
assert.Equal(t, VisitorOAuthScope, doc.Scope)
@@ -88,7 +88,7 @@ func TestBuildClientMetadataDocument_LogoURIUsesBrandLogoEndpoint(t *testing.T)
logoFileID := gid.MustParseGID("WR-qMrB5AAEAGQAAAZ9mIO8B8vDFQ-i3")
portal := &coredata.CompliancePortal{
Title: "Acme Compliance Page",
EntityName: "Acme",
LogoFileID: &logoFileID,
}