Skip to content

feat(frontend): allow public viewing of record pages without requiring login

mondyagu abhilash requested to merge feat/public-record-pages into develop

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

Screenshot_from_2026-05-19_12-33-12

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/:id and /shared/:id do 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

  1. Opened a record URL in an incognito window.
  2. Verified the record page loaded without redirecting to /login.
  3. Opened a shared URL (/shared/<recordId>) and confirmed it loaded publicly.
  4. Clicked the "Copy Link" button and verified the correct URL was copied.
  5. Attempted protected actions while unauthenticated and confirmed a login prompt appeared.
  6. 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.

Edited by mondyagu abhilash

Merge request reports

Loading