boolean-uk / team-dev-frontend-client

1 stars 11 forks source link

BUG: if user does not have cohort #228

Closed lucianosimoni closed 1 year ago

lucianosimoni commented 1 year ago

How to recreate

  1. Login in with a new Student User. - It will come without cohort.
  2. Click on Cohorts
  3. Url will be changed to /cohorts/null because the User does not have a cohort.

Fix:

Remarks

Once it receives a prop called loggedInUser, when calling the component in App.js return, don't forget to pass down this prop to AuthenticateUserCohort.

route to /cohorts/:id must be nested in AuthenticateUserCohort, and this Auth must be nested in a AuthenticateUser.

<AuthentitcateUser>
    <AuthenticateUserCohort>
        <Route />
    </ AuthenticateUserCohort>
</ AuthentitcateUser>
lucianosimoni commented 1 year ago

Fixed in #213