Having to pass secret to getCookieCache in Next.js proxy.ts
I have a proxy.ts file:
When I login via Google (configured already) and access /app, I get an error
Even though I have set the AUTH_SECRET environment url. The only solution is to pass the secret in getCookieCache but I don't understand why this issue is occurring?
When I login via Google (configured already) and access /app, I get an error
Even though I have set the AUTH_SECRET environment url. The only solution is to pass the secret in getCookieCache but I don't understand why this issue is occurring?
Solution
Resolution
So I mentioned I was using
I resolved this issue by instead using
So I mentioned I was using
getCookieCache in proxy.ts I resolved this issue by instead using
getSessionCookie to check the session like so. Note: in the docs this way only checks for the existence of a cookie and you need to add proper session auth checks (such as using auth.api.getSession for Server Components) in your protected pages/routes (I put it in my app layout.tsx)