|
|
|
@ -28,7 +28,14 @@ export const trpcHandler = ((endpoint) => (request, context, runtime) => {
|
|
|
|
|
const jwt = await getToken({
|
|
|
|
|
req,
|
|
|
|
|
secret: "buginoo",
|
|
|
|
|
cookieName: "__Secure-authjs.session-token",
|
|
|
|
|
/** Needed to specify cookie name because for some reason in production
|
|
|
|
|
* it wasn't reading the correct cookie but in development it was. It
|
|
|
|
|
* was not straightforward to fix the name of the cookie in
|
|
|
|
|
* `authOptions`, so I adjusted what cookie to read from here: */
|
|
|
|
|
cookieName:
|
|
|
|
|
env.NODE_ENV === "production"
|
|
|
|
|
? "__Secure-authjs.session-token"
|
|
|
|
|
: "authjs.session-token",
|
|
|
|
|
});
|
|
|
|
|
return {
|
|
|
|
|
...context,
|
|
|
|
|