feat(nextjs): introduce next-auth v5#7443
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
@auth/nextjs
| return (...args: WithAuthArgs) => { | ||
| if (!args.length) { | ||
| // React Server Components | ||
| return getSession(headers(), config).then((r) => r.json()) |
There was a problem hiding this comment.
Hey! Wondering if this return getSession should be abstracted out into a cache() call so that if it's called from multiple server components it only does the fetching once per request?
There was a problem hiding this comment.
A pattern I've seen recently with v4 is to re-export a wrapped getServerSession in a cache() call to get the same effect
import { type NextAuthOptions, getServerSession as naGetServerSession } from "next-auth"
import { cache } from "react";
export const config: NextAuthOptions = { ... };
export const getServerSession = cache(() => naGetServerSession(config));|
Hello, i want to know that all Does anybody has workaround for it? Is it a next.js issue? |
|
Deployment failed with the following error: |
Next.js 13.4 is out.
For discussing project-related issues, please use #8487
The new version of NextAuth.js is based on
@auth/core.If you want to test it out, you can do so already, installing
next-auth@experimental:BREAKING CHANGES
Follow the migration guide