Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 NextJS 中,您必须添加NEXT_PUBLIC_env 变量以使它们可用于浏览器,但“next-auth”仅接受硬编码变量,如NEXTAUTH_URL,有没有办法解决这个问题?
NEXT_PUBLIC_
NEXTAUTH_URL
带有前缀的环境变量NEXT_PUBLIC_将内联在应用程序包中。NEXTAUTH_URL未在捆绑包中使用。API 路由使用它来处理重定向 URL。这意味着您必须在Vercel中定义它。