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.
How to recreate
/cohorts/null
because the User does not have a cohort.Fix:
Create a new component on App.js called
AuthenticateUserCohort
.loggedInUser.cohortId
isnull
, if so, redirect to/posts
, else continue.return
}
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 inAuthenticateUserCohort
, and this Auth must be nested in aAuthenticateUser
.