inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

김강연님의 게시글

김강연 김강연

@rkddus

수강평 작성수
1
평균평점
5.0

게시글 6

질문&답변

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
조회수
699

질문&답변

비디오 상세페이지

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

좋아요수
0
댓글수
1
조회수
289