radicalplatforms/shafa

Enforce Auth in Frontend using Author

Opened this issue · 0 comments

Description

Integrate Author into the frontend. As a user, I'd like to have data unique to my specific user. As of now, every user who hits any endpoint submits and fetches data as the "rak3rman" user. Allow the user to login on the frontend and pass those creds down to the backend. This consists of two big tasks: add middleware to the frontend to automatically support auth, and create a sample page that demonstrates auth enforcement (could be /items).

  • Add middleware to support auth in next
  • Update README to include frontend authentication tips
  • Create sample page to demonstrate auth enforcement

Acceptance Criteria

Generated by Zenhub AI

  • Scenario: Login and Auth Enforcement
  • Given Author exists that allows a user to log in and log out
  • When a user enters their credentials and submits the form
  • Then the user should be redirected to a page that demonstrates auth enforcement (e.g., /items)
  • And the data fetched on this page should be unique to the specific user
  • And the frontend should have middleware supporting auth
  • And the frontend should be able to pass the user's credentials to the backend
  • And the backend should enforce auth for the specific user
  • And the frontend should handle errors and display appropriate messages