Posts
Q&A
tailwindCss ๊ผญ ์ฌ์ฉํด์ผํ๋์?
๋์์ธ์ ๋ค๋ฅธ๊ฒ์ผ๋ก ๋์ฒดํ๊ฑฐ๋(emotion์ด๋ Styped-componenent๊ฐ์ CSS in JS) ๋์์ธ ์ ๊ฒฝ ๋๊ณ ๊ฐ๋ฐ๊ฑด์ ์ง์คํด์ ๊ณต๋ถํ๊ฒ ๋ค ํ๋ฉด tailwindCSS ์ฌ์ฉ ์ํด๋ ๋ฉ๋๋ค.
- 0
- 2
- 994
Q&A
ํ์๊ฐ์ -status 201 Ok- ๋ฆฌ๋ค์ด๋ ํธ ์๋๋ ํ์
ํ์๊ฐ์ ์์ฒญ ํ ํ์ฐธ๋ค์ ์ฐํ ๋ก๊ทธ์ ๋๋ค.์๋ ์ฒจ๋ถํ ์ด๋ฏธ์ง์ const signInResult์ ๊ฐ์ด ์ฐํ์ง ์์ต๋๋ค. Next-auth์์ ์ฒ๋ฆฌํ๋ signIn์ status์ responser๊ฐ๊น์ง๋ ์ฐํ๊ณ SignIn๋ถ๋ถ์ ๋ก๊ทธ๋ ์์ฐํ์201{id: 'zr',nickname: 'zr',image: '/upload/scr-2024-02-214.07.171709446258471.png'}[auth][error] CallbackRouteError: Read more at https://errors.authjs.dev#callbackrouteerror[auth][cause]: TypeError: fetch failedat node:internal/deps/undici/undici:12345:11[auth][details]: {"name": "HeadersTimeoutError","code": "UND_ERR_HEADERS_TIMEOUT","message": "Headers Timeout Error","provider": "credentials"}CallbackRouteError: Read more at https://errors.authjs.dev#callbackrouteerrorat Module.callback (webpack-internal:///(action-browser)/./node_modules/next-auth/node_modules/@auth/core/lib/actions/callback/index.js:437:23)at async AuthInternal (webpack-internal:///(action-browser)/./node_modules/next-auth/node_modules/@auth/core/lib/index.js:67:24)at async Auth (webpack-internal:///(action-browser)/./node_modules/next-auth/node_modules/@auth/core/index.js:126:34)at async signIn (webpack-internal:///(action-browser)/./node_modules/next-auth/lib/actions.js:57:17)at async $$ACTION_0 (webpack-internal:///(action-browser)/./src/app/(beforeLogin)/_lib/signup.ts:54:30)at async /Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:38:489at async tX (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:37:5313)at async rl (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:38:23339)at async doRender (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/server/base-server.js:1406:30)at async cacheEntry.responseCache.get.routeKind (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/server/base-server.js:1567:28)at async DevServer.renderToResponseWithComponentsImpl (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/server/base-server.js:1475:28)at async DevServer.renderPageComponent (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/server/base-server.js:1852:24)at async DevServer.renderToResponseImpl (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/server/base-server.js:1890:32)at async DevServer.pipeImpl (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/server/base-server.js:902:25)at async NextNodeServer.handleCatchallRenderRequest (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/server/next-server.js:266:17)at async DevServer.handleRequestImpl (/Users/jungjuyoung/dev/next-app-router-z/ch4/node_modules/next/dist/server/base-server.js:798:17) {type: 'CallbackRouteError',kind: 'error',[cause]: {err: TypeError: fetch failedat node:internal/deps/undici/undici:12345:11 {cause: [HeadersTimeoutError]},name: 'HeadersTimeoutError',code: 'UND_ERR_HEADERS_TIMEOUT',message: 'Headers Timeout Error',provider: 'credentials'}}
- 0
- 5
- 757
Q&A
MacOs, PostgreSQL16 ์ค์น, pgAdmin 4์์ connection ์ค๋ฅ
๋งฅ๋ถ ํฌ๋งทํด์ ๋ค์ ์ฌ์ค์นํด๋ postgresql ๋๊ฐ์ด ๋น๋ฒํ๋ฆฌ๋ค๊ณ ๋์ค๋ค์ ใ ใ (์ผ๋ถ๋ฌ ๋น๋ฒ๋ ์ฌ์ด๊ฑธ๋ก ์ค์ ํด๋จ๋๋ฐ....)
- 2
- 4
- 970
Q&A
[CallbackRouter Error] ํ์๊ฐ์ ->DB์ ๋ ฅ ์ฑ๊ณต-> ์๋๋ก๊ทธ์ธ ์๋จ
auth.tsํ์ผ import NextAuth from "next-auth" import CredentialsProvider from "next-auth/providers/credentials"; import { NextResponse } from "next/server"; export const { handlers: { GET, POST }, auth, signIn, } = NextAuth({ pages: { signIn: '/i/flow/login', newUser: '/i/flow/signup', }, providers: [ CredentialsProvider({ async authorize(credentials) { const authResponse = await fetch(`${process.env.AUTH_URL}/api/login`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ id: credentials.username, password: credentials.password, }), }) console.log('[auth] CredentialsProvider authResponse: ',authResponse) if (!authResponse.ok) { return null } const user = await authResponse.json() console.log('user', user); return { email: user.id, name: user.nickname, image: user.image, ...user, } }, }), ] });
- 0
- 4
- 1.1K
Q&A
[CallbackRouter Error] ํ์๊ฐ์ ->DB์ ๋ ฅ ์ฑ๊ณต-> ์๋๋ก๊ทธ์ธ ์๋จ
signupํ์ผ "use server"; import { redirect } from "next/navigation"; import { signIn } from "@/auth"; export default async function onSubmit(prevState: any, formData: FormData) { if (!formData.get('id') || !(formData.get('id') as string)?.trim()) { return { message: 'no_id' }; } if (!formData.get('name') || !(formData.get('name') as string)?.trim()) { return { message: 'no_name' }; } if (!formData.get('password') || !(formData.get('password') as string)?.trim()) { return { message: 'no_password' }; } if (!formData.get('image')) { return { message: 'no_image' }; } formData.set('nickname',formData.get('name') as string); let shouldRedirect = false; try { const response = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/users`, { method: 'post', body: formData, credentials: 'include', }) console.log(response.status); if (response.status === 403) { return { message: 'user_exists' }; } console.log('response: ', await response.json()) shouldRedirect = true; await signIn("credentials", { username: formData.get('id'), password: formData.get('password'), redirect: false, }) console.log('signIn shouldRedirect: ',shouldRedirect) } catch (err) { console.error(err); return; } if (shouldRedirect) { redirect('/home'); // try/catch๋ฌธ ์์์ X } }
- 0
- 4
- 1.1K
Q&A
integration ํ ์คํธ์, ๋ชฝ๊ณ ๋๋น์ ๋ฐ์ดํธ ์ ๋ฐ์ดํธ ๋๋ ์ด์ .
์ญ๋ ๋ต๋ณ๊ฐ์ฌํฉ๋๋ค. "์์ดํฐํ ์คํธ"๊ฐ ๋ญ๊ฐ์?
- 0
- 5
- 315
Q&A
react-router-dom ๋ฌธ์ ....
๊ธ์ด์ด๋ react-router๊ฐ ๋ฒ์ ์ด 6์ผ๋ก ์ฌ๋ผ๊ฐ๋ฉด์ ๋ฌธ๋ฒ์ด ๋ฐ๋๊ฑฐ ๊ฐ์ต๋๋ค.Switch-> RoutesRoute->Routes์ ์ง์์์์ผ๋ก ๋ณ๊ฒฝ Component->element๋ก ๋ณ๊ฒฝ ์ฝคํฌ๋ํธ๋ก ์ํดํธ (์ฌ์ง)
- 1
- 2
- 736
Q&A
back์์ npm i ํ์ ๋ ์ค๋ฅ๊ฐ ๋ฉ๋๋ค..
์ค ๊ฐ์ฌํฉ๋๋ค ์ ๋ ๋๊ฐ์ ์๋ฌ ๋ฌ๋๋ฐ ๋๋ถ์ ํด๊ฒฐํ์ด์
- 12
- 9
- 592
Q&A
integration ํ ์คํธ์, ๋ชฝ๊ณ ๋๋น์ ๋ฐ์ดํธ ์ ๋ฐ์ดํธ ๋๋ ์ด์ .
John Ahn๋ ์ ๋ ์๋๊ธ ์ด๋๊ณผ ๋์ผํ๊ฒ ์ดํดํ๋๋ฐ, ์ ๋ํ ์คํธ ํ ๋ postman์์ api ๋ ๋ฆด๋ ๋ถํฐ DB์ ์์ฑ๋๋๋ผ๊ตฌ์. ๊ทผ๋ฐ ์๊ฐํด๋ณด๋ฉด ์ฐ๋ฆฌ๊ฐ ๊ตฌํํ๊ฒ์ด ์ ๋์ํ๋์ง ํ์ธํ๋ ค๋ฉด DB์ ์์ฑ๋๋๊ฑฐ ๊น์ง ํ์ธํ๋๊ฒ ๋ง๋๊ฒ์ด ์๋๊ฐ ์๊ฐ์ด ๋ค๋๋ผ๊ตฌ์. ์๋๋ฉด ์ค์ ๋ก ๋ง๋ค์ด์ ๋์๊ฐ?๋๊ฒ์ DB์ ์ ์์ฑ๋์ผํ๊ณ , DB์ ์์ฑ๋๊ฑธ ์ฝ์ด์์ผํ๊ณ , DB์ ์์ฑ๋ ๋ฐ์ดํฐ๋ฅผ ์ ๋ฐ์ดํธ ํด์ผํ๊ณ , DB์ ์์ฑ๋ ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํ๋ ค๋ฉด, ์ฐ์ DB์ ๋ฐ์ดํฐ๊ฐ ์์ฑ๋๋๊ฑฐ ๊น์ง ํ์ธํ๋๊ฒ ๋ง์ง ์๋ ์ถ์ต์๋ฐ ์๋ชป ์ดํดํ๊ณ ์๋๊ฑด๊ฐ์?
- 0
- 5
- 315
Q&A
http ์ํ์ฝ๋์ ๊ดํ์ฌ
๋ต๋ณ ๊ฐ์ฌํฉ๋๋ค. ๊ฒฐ๊ตญ ์ ๊ฐ ๋ง์๊ฑธ ์๋ ์ ๋ฐ์ ์๊ฒ ๋ค์...
- 0
- 2
- 180