feat(frontend): allow public viewing of record pages without requiring login
MR Title
feat(frontend): allow public viewing of record pages without requiring login
MR Description
Summary
This merge request updates the frontend routing and record detail page behavior to allow unauthenticated users to view record pages publicly. Authentication is required only when users attempt protected actions such as contributing, downloading, liking, or commenting.
Problem
Previously, navigating to a record URL redirected unauthenticated users to the login page before the record content was displayed. This prevented public sharing of record pages and made read-only access unavailable to users without an account.
Changes Made
checked in private window with record id link without login directly opening record details
Frontend Routing
-
Removed authentication guard from the following routes:
/records/:id/shared/:id
-
Both routes now render the existing record detail page component without requiring login.
Authentication for Actions
-
Record details (title, description, media preview, metadata) are visible to all users.
-
Unauthenticated users are prompted to log in or sign up only when they click protected action buttons:
- Contribute
- Download
- Like
- Comment
Redirect Handling
- After successful login or signup, users are redirected back to the same record page they were viewing.
Share Link
-
The "Copy Link" button generates a public URL in the format:
/shared/<recordId>
Files Modified
- Frontend routing configuration
- Record details page component
- Authentication redirect logic
- Share link generation logic
Acceptance Criteria
-
Record pages are accessible without authentication -
Unauthenticated users can view full record details -
/records/:idand/shared/:iddo not redirect to login -
Protected action buttons trigger a login/signup prompt for unauthenticated users -
After login, users are redirected back to the original record URL -
"Copy Link" generates a shareable /shared/<recordId>URL
Testing Performed
- Opened a record URL in an incognito window.
- Verified the record page loaded without redirecting to
/login. - Opened a shared URL (
/shared/<recordId>) and confirmed it loaded publicly. - Clicked the "Copy Link" button and verified the correct URL was copied.
- Attempted protected actions while unauthenticated and confirmed a login prompt appeared.
- Logged in and verified redirection back to the same record page.
Impact
This change enables public sharing and viewing of record pages while preserving authentication requirements for all user actions that modify data or require permissions.
