Closed jacobtipp closed 2 weeks ago
Bump!
Came to the Issues looking for this exact answer. Is it just so validateRequest
can also be used in route handlers, server actions, and server components without having to have separate functions for each?
TYIA
Yeah it's just easier to swallow the error and make validateRequest()
available everywhere. We set expires: false
which sets the cookie (not the session itself) expiration to a year instead of the default 30 days (or however long you set the session expiration to)
In the nextjs app router examples, I noticed that you are setting the session cookie inside the
validateRequest
method.validateRequest
is then used in server components to check for the user session. Normally nextjs would throw an error but you seem to be swallowing it with the try catch block. What are the implications of this?