小编Евг*_*еев的帖子

如何使用 next-auth 在 Next.js 中实现凭据授权?

我试图让证书身份验证与下一个权威性的,但我没有经验使用它,无论我做什么,我得到以下信息: [next-auth][error][callback_credentials_jwt_error] Signin in with credentials is only supported if JSON Web Tokens are enabled https://next-auth.js.org/errors#callback_credentials_jwt_error 。也许,结果是一团糟,但我希望你能帮助我。

这是我的 src/pages/api/auth/[...nextauth].js 文件。

import NextAuth from 'next-auth'
import Providers from 'next-auth/providers'
import User from "@models/User"

const options = {
    NEXTAUTH_URL:process.env.NEXTAUTH_URL,
    providers: [
        Providers.Credentials({
            // The name to display on the sign in form (e.g. 'Sign in with...')
            name: 'Avista',
            // The credentials is used to generate a suitable form on the sign in page.
            // You can specify whatever fields you …
Run Code Online (Sandbox Code Playgroud)

next.js next-auth

5
推荐指数
1
解决办法
6802
查看次数

标签 统计

next-auth ×1

next.js ×1