rtp-atw / nimble-interview

Nimble Repository
https://nimble-interview.vercel.app
MIT License
0 stars 0 forks source link

[Chore] Move Up Shared Concerns #23

Closed olivierobert closed 8 months ago

olivierobert commented 8 months ago

Issue

In the Next.JS, there is a bit of duplication between pages that could be solved by moving some concerns higher-up, e.g., the authentication logic is used in many places:

useProfile useRequireAuth
image image

Expected

Such shared business logic can be implemented using the context API as it simplifies implementation and allows to set up guards at a higher-level (instead of being at the component level).

[!Note]