MCPcopy Create free account
hub / github.com/simstudioai/sim / generateMetadata

Function generateMetadata

apps/sim/app/f/[token]/page.tsx:36–62  ·  view source on GitHub ↗
({ params }: PublicFilePageProps)

Source from the content-addressed store, hash-verified

34 * filename never leaks before the visitor authenticates. Always `noindex`.
35 */
36export async function generateMetadata({ params }: PublicFilePageProps): Promise<Metadata> {
37 const { token } = await params
38 const resolved = await resolveShare(token)
39 if (!resolved) {
40 return { robots: NOINDEX }
41 }
42
43 let title: string
44 let description: string
45 if (resolved.share.authType !== 'public') {
46 title = 'Shared file'
47 description = 'Authentication is required to view this file.'
48 } else {
49 title = resolved.file.originalName
50 description =
51 buildProvenance(resolved.workspaceName, resolved.ownerName) || `Shared file · ${title}`
52 }
53
54 const brand = getBrandConfig()
55 return {
56 title,
57 description,
58 robots: NOINDEX,
59 openGraph: { type: 'website', title, description, siteName: brand.name },
60 twitter: { card: 'summary_large_image', title, description },
61 }
62}
63
64/** The auth-relevant slice of a resolved share row. */
65interface GateShare {

Callers

nothing calls this directly

Calls 2

buildProvenanceFunction · 0.90
getBrandConfigFunction · 0.90

Tested by

no test coverage detected