How to redirect a authenticated user if tries to access some particular url

I am using nextjs with auth0
I have a landing page which should be shown only to unauthenticated users .
When the user is authenticated I want to redirect from / to /dashboard.
I am able to achieve that .
The thing that I am not able to find is how to redirect a authenticated user if is already logged in before and tried to navigate the home page .
Is there any auth0 hook/method to handle this case or do we have to rely on methods provided by next to route .

Can anyone help , It’s been 4 days

Hey there!

Let me ask you one follow up question so I can understand your usecase better. This authenticated user let’s say is logged in the application stops using it and then in 4 minutes gets back to it let’s say and you want them to be on other page than /home?

No not exactly . @konrad.sopala
Let’s say the user is authenticated .

He enters the url in browser as https://yourdomain.com i.e the home page .
In this case he should be redirected to /dashboard as he is a authenticated user

You can coinsider this as the reverse process for what onRedirecting method in withpageauthrequired
does

any leads on It @konrad.sopala

still waiting on it @konrad.sopala.
Can you ask someone in your team who can help out with the issue.