Introduction
Posts
Q&A
hydration 오류 (Fragment key값)
세팅 문제 같아 백엔드 서버 세팅 다시 하고 실행해 봤을때 (nest-prisma파일 1월 6일 기준) postForm부분에서 /api/posts에서 500 에러가 발생하고 있습니다..! user 정보(authjs.session-token)도 잘 받아오고 있습니다..ㅠㅜ(사진)(사진)// 백엔드 터미널 오류 내용 canActivate with req.user undefined eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwia2lkIjoieFQ0MjR1azFqQi1xRlFINjRfaVY0OE4tRHRNbzh1b3JHSHZENnhVRFI1Tm5Za3JYRHBGbU5yZlVfd3Z4TmUzT2lqUUdVWFhTYkhGZXYtM295YVM0QUEifQ..W_hVRdWsTS-VthkfaJClwA.FO9GzpLUvS7u13TGyAU0NOm3T31wpThqCsKw6DGWTNiLrB9qPojT46wzKSprfxdphVwaTtuU_T_PWPfKOeQ4CerC1UhmqnCB2NpDdvaqy8dzQhx04DluwW3gtZwsMnsG5s3Y0XV76FBOZ0NyeNFApg0wktotHD-C7bawlWTVYySjr4DI0QfAq0zcLUTJYvJt8eRoicHkYynka9RJaJnqnKESDDfbRt_zHeykblhbRaE.DBUwZAHepn3XCyZgJioJQZCIUQ8zs5GeO5Y0wnY2jkM [Nest] 33332 - 2025. 01. 06. 오후 4:49:28 ERROR [ExceptionsHandler] no matching decryption secret Error: no matching decryption secret at jwtDecrypt.clockTolerance (file:///C:/Users/alsdu/Desktop/nest-prisma-main/node_modules/@auth/core/jwt.js:76:15) at flattenedDecrypt (file:///C:/Users/alsdu/Desktop/nest-prisma-main/node_modules/jose/dist/node/esm/jwe/flattened/decrypt.js:92:15) at compactDecrypt (file:///C:/Users/alsdu/Desktop/nest-prisma-main/node_modules/jose/dist/node/esm/jwe/compact/decrypt.js:15:23) at jwtDecrypt (file:///C:/Users/alsdu/Desktop/nest-prisma-main/node_modules/jose/dist/node/esm/jwt/decrypt.js:5:23) at decode (file:///C:/Users/alsdu/Desktop/nest-prisma-main/node_modules/@auth/core/jwt.js:67:25) at LoggedInGuard.canActivate (C:\Users\alsdu\Desktop\nest-prisma-main\src\auth\logged-in-guard.ts:17:23) at GuardsConsumer.tryActivate (C:\Users\alsdu\Desktop\nest-prisma-main\node_modules\@nestjs\core\guards\guards-consumer.js:16:17) at canActivateFn (C:\Users\alsdu\Desktop\nest-prisma-main\node_modules\@nestjs\core\router\router-execution-context.js:134:33) at C:\Users\alsdu\Desktop\nest-prisma-main\node_modules\@nestjs\core\router\router-execution-context.js:42:31 at C:\Users\alsdu\Desktop\nest-prisma-main\node_modules\@nestjs\core\router\router-proxy.js:9:17 [Nest] 33332 - 2025. 01. 06. 오후 4:49:28 LOG [HTTP] POST /api/posts 500 52 - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 ::1// .env NEXT_PUBLIC_BASE_URL=http://localhost:9090 AUTH_SECRET=비번 NEXT_PUBLIC_MODE=local NEXT_PUBLIC_MSW_ENABLED=false // postForm.tsx(onSubmit) const onSubmit: FormEventHandler = async (e) => { e.preventDefault(); const formData = new FormData(); formData.append('content', content); preview.forEach((p) => { p && formData.append('images', p.file); }) try{ const response = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/posts`, { method: 'post', credentials: 'include', body: formData, }); if (response.status === 201) { setContent(''); setPreview([]); const newPost = await response.json(); queryClient.setQueryData(['posts', 'recommends'], (prevData: { pages: Post[][] }) => { const shallow = { ...prevData, pages: [...prevData.pages], }; shallow.pages[0] = [...shallow.pages[0]]; shallow.pages[0].unshift(newPost); return shallow; }); queryClient.setQueryData(['posts', 'recommends'], (prevData: { pages: Post[][] }) => { const shallow = { ...prevData, pages: [...prevData.pages], }; shallow.pages[0] = [...shallow.pages[0]]; shallow.pages[0].unshift(newPost); return shallow; }); queryClient.setQueryData(['posts', 'followings'], (prevData: { pages: Post[][] }) => { const shallow = { ...prevData, pages: [...prevData.pages], }; shallow.pages[0] = [...shallow.pages[0]]; shallow.pages[0].unshift(newPost); return shallow; }); } } catch(err){ alert('업로드 중 에러발생'); } };
- 0
- 3
- 48
Q&A
action이 true일때 실행되는데 false에서 초기화가 안되요ㅠ
감사합니다ㅜㅠ 잘 작동돼요..!
- 0
- 2
- 241