and the signin page /auth/signin const handleLoginSubmit = async (e) => { e.preventDefault(); const signInUrl = `${process.env.NEXT_PUBLIC_API_SERVICE_BASE_URL}/api/v1/User/Login`; const res = await signIn('credentials', { username: loginInput.username, passw...
配置.env 的NEXTAUTH_URL这个默认是http://localhost:3000如果测试的时候换过端口什么的一定要跟着改。 配置 配置OAuth 的回调 Callback url 的地址格式大致为:/api/auth/callback/[provider]。 对应到上面介绍的Github的地址就是:http://localhost:3000/api/auth/signin/github ...
export default NextAuth({ // Configure one or more authentication providers providers: [ SpotifyProvider({ clientId: process.env.NEXT_PUBLIC_CLIENT_ID, clientSecret: process.env.NEXT_PUBLIC_CLIENT_SECRET, authorization: LOGIN_URL }) // ...add more providers here ], secret: process.env...
固定。回调URL不应类似于"http://127.0.0.1:3000/user/dashboard",而应类似于:'/用户/ Jmeter...
password); if (passwordsMatch) return user; return null; } return null; }, }), ], } satisfies NextAuthConfig; 我相信这些都是对错误有用的文件,上下文如下所示: Read more at https://errors.authjs.dev/#credentialssignin [auth][error] CallbackRouteError: Read more at https://errors.auth...
固定。回调URL不应类似于"http://127.0.0.1:3000/user/dashboard",而应类似于:'/用户/ Jmeter...
signIn("apple", { callbackUrl: "/send-me-here", }) And this is how my NextAuthOptions looks like now: export const authOptions: NextAuthOptions = { cookies: { callbackUrl: { name: `__Secure-next-auth.callback-url`, options: { httpOnly: false, sameSite: "none", path: "/", ...
好吧,我终于自己弄明白了,原来我没有读我的nginx日志正确,一旦我这样做了,这不是什么太难...这里...
https://next-01-test.vercel.app/api/auth/signin?error=Callback Request Method: GET Status Code: 304 Not Modified Referrer Policy: strict-origin-when-cross-origin equest URL: https://next-01-test.vercel.app/api/auth/error?error=Callback Request Method: GET Status Code: 302 Found Referrer ...
调试完代码后,我得出了以下结论:next-auth redirect / callbackUrl / cookie设置有错误。所以我设法...