From d2d0d16e4d5ac36abd92e80aaa3abc47357f8b2f Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Mon, 10 Aug 2026 16:24:52 +0200 Subject: [PATCH] fix(workshop): use PocketBase name --- apps/docs/docs/management/workshop/index.mdx | 4 ++-- .../components/workshop/DetailComments.tsx | 16 +++++-------- .../src/components/workshop/DetailPage.tsx | 8 +++---- .../workshop/WorkshopAccountMenu.tsx | 10 ++++---- .../src/components/workshop/WorkshopAdmin.tsx | 14 +++++------ .../src/components/workshop/WorkshopApp.tsx | 15 +++++------- .../components/workshop/workshop-browser.tsx | 6 ++--- apps/workshop/README.md | 4 ++-- apps/workshop/pb_hooks/workshop.pb.js | 6 ++--- .../1784240000_workshop_widgets.js | 11 ++++----- .../workshop/tests/oauth-sync.integration.mjs | 2 +- apps/workshop/tests/workshop-contracts.mjs | 4 ++-- apps/workshop/tests/workshop.integration.mjs | 12 +++++----- .../custom-widget/workshop-procedures.ts | 4 ++-- packages/workshop/src/backend.ts | 23 ++++++++----------- packages/workshop/src/client.spec.ts | 7 +++--- packages/workshop/src/schema.spec.ts | 2 +- packages/workshop/src/schema.ts | 8 +++---- 18 files changed, 71 insertions(+), 85 deletions(-) diff --git a/apps/docs/docs/management/workshop/index.mdx b/apps/docs/docs/management/workshop/index.mdx index 9df9874c9..78e9c89cb 100644 --- a/apps/docs/docs/management/workshop/index.mdx +++ b/apps/docs/docs/management/workshop/index.mdx @@ -95,8 +95,8 @@ irreversible development reset. GitHub needs only the central callback `https:///api/oauth2-redirect`. Keep PocketBase origins unrestricted unless every self-hosted Homarr caller is explicitly listed. Configure both `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET`; supplying only one is a startup error. Set `WORKSHOP_PUBLIC_ORIGIN` in production so generated -links and email use the public host. Workshop stores only the OAuth provider username in `users.githubUsername`, and -users cannot rename it. Map **OAuth2 username** to `githubUsername`; leave OAuth2 id, full name, and avatar mappings +links and email use the public host. Workshop stores only the OAuth provider username in `users.name`, and +users cannot rename it. Map **OAuth2 username** to `name`; leave OAuth2 id, full name, and avatar mappings empty. Profile and avatar URLs are derived from `https://github.com/` and `https://github.com/.png`, so PocketBase does not store duplicate profile metadata or avatar files. Configure SMTP for comment, report, and removal notices. diff --git a/apps/docs/src/components/workshop/DetailComments.tsx b/apps/docs/src/components/workshop/DetailComments.tsx index 381411ff3..021769783 100644 --- a/apps/docs/src/components/workshop/DetailComments.tsx +++ b/apps/docs/src/components/workshop/DetailComments.tsx @@ -159,12 +159,10 @@ export const CommentsSection = ({ submissionId, backend, currentUser, onRequireA const canDelete = ownComment || currentUser?.isAdmin === true; const isEditing = editingId === comment.id; const edited = comment.updated !== comment.created; - const authorGithubUsername = ownComment - ? (currentUser?.githubUsername ?? comment.authorGithubUsername) - : comment.authorGithubUsername; - const authorName = authorGithubUsername || "Community member"; - const avatarUrl = githubAvatarUrl(authorGithubUsername); - const profileUrl = githubProfileUrl(authorGithubUsername); + const authorHandle = ownComment ? (currentUser?.name ?? comment.authorName) : comment.authorName; + const authorName = authorHandle || "Community member"; + const avatarUrl = githubAvatarUrl(authorHandle); + const profileUrl = githubProfileUrl(authorHandle); return (
- {currentUser?.githubUsername && } - - {avatarFallback(currentUser?.githubUsername ?? "Guest")} - + {currentUser?.name && } + {avatarFallback(currentUser?.name ?? "Guest")}