mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
feat: public profile page for actor URL
Replace the browser redirect on /activitypub/users/:handle with a standalone HTML profile page showing avatar, bio, profile fields, stats (posts/following/followers/joined), follow-me prompt with copy button, pinned posts, and recent posts. Supports light/dark mode via prefers-color-scheme. ActivityPub clients still get JSON-LD from Fedify before this route is reached.
This commit is contained in:
7
index.js
7
index.js
@@ -58,6 +58,7 @@ import {
|
||||
featuredTagsRemoveController,
|
||||
} from "./lib/controllers/featured-tags.js";
|
||||
import { resolveController } from "./lib/controllers/resolve.js";
|
||||
import { publicProfileController } from "./lib/controllers/public-profile.js";
|
||||
import {
|
||||
refollowPauseController,
|
||||
refollowResumeController,
|
||||
@@ -158,11 +159,9 @@ export default class ActivityPubEndpoint {
|
||||
return self._fedifyMiddleware(req, res, next);
|
||||
});
|
||||
|
||||
// HTML fallback for actor URL — redirect browsers to the site homepage.
|
||||
// HTML fallback for actor URL — serve a public profile page.
|
||||
// Fedify only serves JSON-LD; browsers get 406 and fall through here.
|
||||
router.get("/users/:identifier", (req, res) => {
|
||||
res.redirect(self._publicationUrl || "/");
|
||||
});
|
||||
router.get("/users/:identifier", publicProfileController(self));
|
||||
|
||||
// Catch-all for federation paths that Fedify didn't handle (e.g. GET
|
||||
// on inbox). Without this, they fall through to Indiekit's auth
|
||||
|
||||
Reference in New Issue
Block a user