Add SSR for compliance page with dynamic title and meta tags

Implement server-side rendering of trust center page `<head>` with dynamic organization name and OG meta tags. Adds generic `FileRenderer` mechanism to statichandler for dynamic file rendering, allowing the trust server to inject templated content at request time.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-18 15:55:18 +01:00
parent ea21f85887
commit 751d9eb1f3
5 changed files with 177 additions and 51 deletions

View File

@@ -273,6 +273,30 @@ func (s *Service) EmailPresenterConfigByOrganizationID(ctx context.Context, orgI
return s.WithTenant(orgID.TenantID()).TrustCenters.EmailPresenterConfig(ctx, trustCenter.ID)
}
func (s *Service) GetOrganizationByTrustCenterID(
ctx context.Context,
trustCenterID gid.GID,
) (*coredata.Organization, error) {
trustCenter, err := s.Get(ctx, trustCenterID)
if err != nil {
return nil, fmt.Errorf("cannot load trust center: %w", err)
}
org := &coredata.Organization{}
err = s.pg.WithConn(
ctx,
func(conn pg.Conn) error {
return org.LoadByID(ctx, conn, coredata.NewNoScope(), trustCenter.OrganizationID)
},
)
if err != nil {
return nil, fmt.Errorf("cannot load organization: %w", err)
}
return org, nil
}
func (s *Service) GetMembershipByCompliancePageIDAndIdentityID(ctx context.Context, compliancePageID gid.GID, identityID gid.GID) (*coredata.TrustCenterAccess, error) {
membership := &coredata.TrustCenterAccess{}