radicalplatforms/shafa

Enforce Auth in Backend using Author

Opened this issue · 0 comments

Description

Integrate Author into the backend. 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.

  • Add middleware to support auth in hono
  • Update routes to inject authorUsername
  • Update frontend sample page (#49) to fetch backend data using an authenticated route
  • Update README to include tips/tools on how to hit the backend when auth is enforced
  • Update testing harness if needed to deal with auth

Acceptance Criteria

Generated by Zenhub AI

  • Scenario: Enforce Auth in Backend using Author
  • Given there is a backend API with routes that require authentication
  • When a user logs in on the frontend and passes their credentials to the backend
  • Then the backend should return data unique to the specific user
  • And the frontend should fetch backend data using an authenticated route
  • And the README should include tips/tools on how to hit the backend when auth is enforced