Hi, I am currently adding auth to a nextjs app and using the nextjs sample app as a starting point. In that app, you have a hardcoded redirect to a profile page after login. However, I’d want to be able to redirect a user back to whatever protected page they originally were trying to access. How can I pass in that path? I tried passing it as a query param in the redirect url but that resulted in an error. Searched the docs but did not see anything. Any insight or advice would be appreciated!
Also, on a possibly unrelated note, why is the authenticate logic on a client-side webpage? Is it possible to move that logic to the server?