Hi,
I’m using Next.js app router and I’m able to redirect to /dashboard
after successful login.
Now I want to change my route to /dashboard/[userId]
. How can I redirect to this route path together with the user id?
Hi,
I’m using Next.js app router and I’m able to redirect to /dashboard
after successful login.
Now I want to change my route to /dashboard/[userId]
. How can I redirect to this route path together with the user id?
Hi @tjhoo,
Welcome back to the Auth0 Community and sorry for the late replt.
As you have mentioned, you are able to route users to a /dashboard
, but redirecting them to a /dashboard/[userId]
requires setting up a dynamic Allowed Callback URL, which does not work for a such a routing, since that will require a wildcard.
You can use a wildcard in the subdomain (as long as it follows the guidelines outlined in the documentation). However, to follow OAuth 2.0 Security Best Current Practice, you cannot use a wildcard in the URL path.
For example, you can use https://*.example.com
, however you cannot use https://example.com/*.
This Knowledge Article explains this as well.
I hope this helps clarify the case and just wanted to leave this out here, in case it help others as well.
Thanks,
Remus