Moar federation

This commit is contained in:
Tim Zöller 2025-12-02 22:23:29 +01:00
parent d47daa6dfc
commit 4c9bcc718f
5 changed files with 376 additions and 29 deletions

View file

@ -271,7 +271,11 @@
async function loadActivity() {
try {
const response = await FitPubAuth.authenticatedFetch(`/api/activities/${activityId}`);
// Use authenticated fetch if user is logged in, otherwise regular fetch
// This allows public activities to be viewed without authentication
const response = FitPubAuth.isAuthenticated()
? await FitPubAuth.authenticatedFetch(`/api/activities/${activityId}`)
: await fetch(`/api/activities/${activityId}`);
if (response.ok) {
const activity = await response.json();