Accessing returnTo value in nextjs-auth0 AfterCallback

In a Next.js app using the nextjs-auth0 package, I’d like to examine the returnTo value being passed to the app in the HandleCallback function.

I notice that the login state query param that gets passed to the HandleCallback function is base64-encoded JSON right now. I’ve been able to get at the returnTo value by decoding that.

My concern is that this is relying on an implementation detail of nextjs-auth0. Is reading the base64-encoded value bad practice? Is there a better way to read the returnTo value?