Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create withAuth component to manage automatic redirect to login page #1472

Open
trillium opened this issue Aug 24, 2023 · 4 comments · May be fixed by #1852
Open

Create withAuth component to manage automatic redirect to login page #1472

trillium opened this issue Aug 24, 2023 · 4 comments · May be fixed by #1852

Comments

@trillium
Copy link
Member

Overview

The auth component is imported in multiple locations protecting components that should only be accessed when the user is logged in. This can be more easily handled with a hook to make the code cleaner.

Action Items

  • Create a hook that consumes the users log in state and redirects to the login page if the user is not logged in.
  • Replace instances of the old redirect method.
@trillium trillium added role: Front End size: 2pt Can be done in 7-12 hours labels Aug 24, 2023
@trillium trillium added this to the 04.01 Existing Features milestone Aug 24, 2023
@JackHaeg JackHaeg moved this to Prioritized Backlog in P: VRMS: Project Board Jun 13, 2024
@angela-lee1 angela-lee1 self-assigned this Jun 18, 2024
@angela-lee1 angela-lee1 removed their assignment Jul 29, 2024
@pluto-bell pluto-bell assigned pluto-bell and unassigned pluto-bell Oct 28, 2024
@bconti123 bconti123 self-assigned this Jan 24, 2025
@bconti123 bconti123 moved this from Prioritized Backlog to In progress in P: VRMS: Project Board Jan 24, 2025
@JackHaeg
Copy link
Member

Hi @bconti123! When you have a moment, can you please provide an update with the following information:

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures or links* (if necessary): "Add any pictures or links that will help illustrate what you are working on."
  • remember to add links to the top of the issue if they are going to be needed again.

@bconti123
Copy link
Member

bconti123 commented Jan 28, 2025

Hi @JackHaeg!

  1. Progress: I've created a new hook called withAuth. I still need to review multiple locations within the page folder where useAuth hook is imported.
  2. Blockers: Events, ManageProjects, ProjectList, and UserAdmin components have different statements that redirect to the login page. I need to figure out how to simplify and clean up code.
  3. Availability: 5-10 hours a week to work on an issue.
  4. ETA: I expect to finish the issue in 1-2 weeks.

@JackHaeg
Copy link
Member

JackHaeg commented Feb 4, 2025

Hi @bconti123! When you have a moment, can you please provide an update with the following information:

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures or links* (if necessary): "Add any pictures or links that will help illustrate what you are working on."
  • remember to add links to the top of the issue if they are going to be needed again.

@bconti123
Copy link
Member

Hi @JackHaeg,

  1. Progress: I've refactored 4 components by commenting out old redirect method and checked VRMS website. withAuth works now. What is left to do? I will remove old redirect method and useAuth hook in each component. I double check ProjectForm.jsx if to see I can fix and refactor that code.
  2. Blockers: I ran a roadblock where the website doesn't receive logged-in data after clicking refresh button, pressing F5, or typing out localhost.com:3000/[name].
  3. 5-10 hours this week to work if needed.
  4. I will complete an issue and submit PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment