inflearn logo
Khóa học

Khóa học

Chia sẻ kiến thức

Bài viết của rkddus

rkddus rkddus

@rkddus

Số lượng đánh giá đã viết
1
Xếp hạng trung bình
5.0

Bài viết 5

Hỏi & Đáp

Cannot read properties of undefined (reading 'substring')

import NextAuth from "next-auth"; import CredentialsProvider from "next-auth/providers/credentials"; export const { handlers: { GET, POST }, auth, signIn, } = NextAuth({ pages: { signIn: "/i/flow/login", newUser: "/i/flow/signup", }, providers: [ CredentialsProvider({ name: "Credentials", credentials: { username: { label: "Username", type: "text", placeholder: "Username" }, password: { label: "Password", type: "password", placeholder: "Password", }, }, async authorize(credentials) { const authResponse = await fetch( `${process.env.NEXT_PUBLIC_BASE_URL}/api/login`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ id: credentials?.username, password: credentials?.password, }), } ); if (!authResponse.ok) { return null; } const user = await authResponse.json(); return user; }, }), ], });

Lượt thích
0
Số bình luận
6
Lượt xem
691

Hỏi & Đáp

비디오 상세페이지

선생님 어제 서버 문제였던거 같아요 오늘은 잘 되네요

Lượt thích
0
Số bình luận
1
Lượt xem
288