Changeset 743bb81 in Klonkt for src/routes/hub.js


Ignore:
Timestamp:
06/14/2026 03:15:52 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
6e0249f
Parents:
4d7443b
Message:

hub: fix /user/:slug showed the overview instead of the site + heading "from users"

resolveSite rewrites /user/:slug to req.url='/', causing the hub route
GET / to pick it up again and show the overview instead of the clicked
site. Fix: overview only on the real root (siteUrlBase empty); otherwise
next() -> posts.js renders the site. Section title -> "Latest posts from users".

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/hub.js

    r4d7443b r743bb81  
    1616router.get('/', (req, res, next) => {
    1717  if (getTenancy() !== 'hub') return next();
     18  // Als resolveSite een specifieke site adresseerde (/user/:slug of /sites/:slug),
     19  // is req.url naar '/' herschreven — dan NIET de overview tonen maar de site zelf
     20  // laten renderen door posts.js. siteUrlBase is dan gezet.
     21  if (res.locals.siteUrlBase) return next();
    1822
    1923  // Laatste gepubliceerde posts over álle sites heen.
Note: See TracChangeset for help on using the changeset viewer.