Moar federation
This commit is contained in:
parent
d47daa6dfc
commit
4c9bcc718f
5 changed files with 376 additions and 29 deletions
|
|
@ -247,6 +247,12 @@ const FitPubAuth = {
|
|||
return;
|
||||
}
|
||||
|
||||
// Activity detail pages are public (for viewing public activities)
|
||||
// Pattern: /activities/{uuid}
|
||||
if (currentPath.startsWith('/activities/') && currentPath.split('/').length === 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if authenticated
|
||||
if (!this.isAuthenticated()) {
|
||||
// Redirect to login for protected pages
|
||||
|
|
|
|||
|
|
@ -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