Moar federation
This commit is contained in:
parent
d47daa6dfc
commit
4c9bcc718f
5 changed files with 376 additions and 29 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue