Skip to content

Conversation

@bconti123
Copy link
Member

@bconti123 bconti123 commented Feb 5, 2025

Fixes #1472

What changes did you make and why did you make them?

  • Created withAuth hook to manage automatic redirect to login page.
  • Removed instances of old redirect method and refactored code in Events, UserAdmin, ProjectList, and ManageProjects components.
  • Added auth to the props of ManageProjects and ProjectList components.
  • Added an explanation of the withAuth hook as a comment in App.jsx.
  • Why: To make the code cleaner and reduce the number of lines. In the future, withAuth component will be added to the new component.
  • Wasn't able to fix the redirect method, so decided to leave it as is in the ProjectForm component and index.jsx due to the complexity of the code. Updated: 02/28/2025 - Removed the redirect method in the ProjectForm and admin/dashboard/index.js components. The withAuth hook works.

@dannyprikaz
Copy link
Member

dannyprikaz commented Feb 25, 2025

Hey, Bryant. I like the hook that you set up. It looks like it's working well, but I think there's one more component, admin/dashboard/index.js that should have a Redirect removed and have the wrapper added.

@bconti123
Copy link
Member Author

Thank you for pointing out the component I missed. I am working on admin/dashboard/index.js to remove the Redirect method and see if it works.

Copy link
Member

@dannyprikaz dannyprikaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I resolved a conflict on the ManageProjects.jsx page, and it looks like everything is working properly. Thanks, @bconti123

@dannyprikaz dannyprikaz added the ready for 2nd review When a PR is ready for another reviewer label Mar 4, 2025
@JackHaeg
Copy link
Member

JackHaeg commented Mar 4, 2025

Confirmed that PR is ready for a 2nd review.

@kurtmgray kurtmgray self-requested a review March 10, 2025 23:13
Copy link
Member

@kurtmgray kurtmgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool hook, all functionality remains. Fixed one merge conflict in App.jsx.

@bconti123 bconti123 merged commit d439737 into hackforla:development Mar 11, 2025
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: medium ready for 2nd review When a PR is ready for another reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create withAuth component to manage automatic redirect to login page

5 participants