跳至内容
从 NextAuth.js v4 迁移?阅读 我们的迁移指南.

WorkOS 提供商

资源

设置

回调 URL

https://example.com/api/auth/callback/workos

环境变量

AUTH_WORKOS_ID
AUTH_WORKOS_SECRET

WorkOS 还要求您将 connection ID 传递给提供商。

配置

/auth.ts
import NextAuth from "next-auth"
import WorkOS from "next-auth/providers/workos"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [WorkOS({ connection: "conn_abc123" })],
})
Auth.js © Balázs Orbán 和团队 -2024