Web Security · Senior · Question 71 of 75
Where should authorization logic live in a full-stack framework app to be the most reliable?
- ✓Correct answer: In a data access layer that every read and write goes through, so no route can forget the check
- 2Only in page components, near the UI
- 3Only in the client-side router guards
Explanation
Centralizing checks next to the data means new pages, actions and APIs inherit them. UI and middleware checks are extra layers.