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
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).
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:
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).