소개
게시글
질문&답변
2024.10.06
Cannot read properties of undefined (reading 'substring')
선생님 api/auth/signin 으로 가면 해당 에러가 나옵니(사진)다
- 0
- 6
- 121
질문&답변
2024.10.06
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; }, }), ], });
- 0
- 6
- 121
질문&답변
2024.10.06
Cannot read properties of undefined (reading 'substring')
(사진)middleware가 보여서 남겨봅니다
- 0
- 6
- 121
질문&답변
2024.10.06
Cannot read properties of undefined (reading 'substring')
(사진)
- 0
- 6
- 121
고민있어요
2024.05.08 19:36
센세.....강의에 오류가 너무 많이 나는데 어떻게 해야 합니까??
- 0
- 0
- 131