Need help for my React app authentication flow

So, I do have a route that the app routes to after the authentication which is “/dashboard” and I am using withAuthenticationRequired on that route like this:

But I need my “/dashboard” route to be accessible if the user has the access token from auth0 OR the guestToken I generate through my API. And when the second case with the guestToken occurs it redirects me to the login form from auth0.

How can I solve this specific problem?