docs: fix redirect loop in auth code example (#62589)
### What?
If the user is logged in and on the dashboard, no need to redirect.
### Why?
#62547
### How?
We still want to redirect to the dashboard from other routes, if the
user is logged in already.
Fixes #62547, also related #62548
Closes NEXT-2619