I have a NextJS 13 app on which I've implemented auth.
I have an API route /login that's called by the client with a POST request (with a username and password). It implements the necessary auth logic and then sends a response by setting the client's headers to the auth tokens.
Then, if the response is successful, the client app redirects itself to the / route.
I'm wondering if the server could also redirect the client, taking away any responsibility during auth.