Authorization RBAC with dynamic roles

Navigate them to a page that you then work out that logic on and then on that page send them to where is needed.

for example this is what I do I route them to a pickTeam page


const PickTeam = (): ReactElement => {
  const { currentUser } = useAuth()
 // can do we know there name and or skiped avatar if done not redirect them to page to give details
  if (currentUser.user.onboardingHasName === 'notStarted') {
    return <Redirect to={routes.onboardingUpdateName()} />
  } else if (currentUser.user.onboardingHasAvatar === 'notStarted') {
    return <Redirect to={routes.onboardingUpdateAvatar()} />
  }

// render pick team cell
  return (
    <LoginLayout noPadding>
      <PickTeamCell />
    </LoginLayout>
  )
}
1 Like