You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to implement a system for securing pages based on user authentication and authorization, as well as provide a global user context throughout the frontend application.
Tasks
Implement a higher-order component (HOC) for protected routes:
Create a withAuth HOC that checks for user authentication
Implement redirection to login page for unauthenticated users
Add support for role-based access control in the HOC
Set up user context using React Context API:
Create a UserContext with user information and authentication status
Implement a UserProvider component to wrap the application
Create custom hooks for accessing and updating user context
Integrate user context with authentication flow:
Update user context on successful login
Clear user context on logout
Implement automatic context update on token refresh
Secure individual pages:
Apply the withAuth HOC to pages requiring authentication
Implement role-based page access using the Authorization Service
Create a navigation guard:
Implement a component that checks user permissions before rendering links
Hide or disable navigation items based on user roles
Description
We need to implement a system for securing pages based on user authentication and authorization, as well as provide a global user context throughout the frontend application.
Tasks
Implement a higher-order component (HOC) for protected routes:
withAuth
HOC that checks for user authenticationSet up user context using React Context API:
UserContext
with user information and authentication statusUserProvider
component to wrap the applicationIntegrate user context with authentication flow:
Secure individual pages:
withAuth
HOC to pages requiring authenticationCreate a navigation guard:
Implement client-side role-based content rendering:
Set up persistent authentication:
Handle authentication timeouts:
Create a user profile page:
Implement error boundaries:
Add loading states:
Test protected routes and user context:
withAuth
HOC and user context hooksAcceptance Criteria
withAuth
HOC and user context hooksThe text was updated successfully, but these errors were encountered: