hyoloui
@hyoloui
Reviews Written
-
Average Rating
-
Posts
Q&A
์ ์๋๊ป์ ์ฌ์ฉํ์๋ IDE์ ๋ํด์ ๊ถ๊ธํฉ๋๋ค.
์ ๋ ๊ถ๊ธํฉ๋๋ค
- Likes
- 0
- Comments
- 2
- Viewcount
- 474
Q&A
์๋ ์์ ์ค์ ๋ญ ๋จน๊ณ ์์ผ๋ฉด ์ด๋กํด์;
ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ
- Likes
- -2
- Comments
- 2
- Viewcount
- 495
Q&A
setCookie ์ง๋ฌธ์ ๋๋ค.
Set-Cookie๋ ๋ฐฑ์๋ ์๋ฒ์์ ๋ถ์ฌ์ฃผ๋ ์ฟ ํค์ด๊ธฐ ๋๋ฌธ์next.js ๋ฅผ ํตํด ์๋ฒ ํต์ ์ ํ๋ค๋ฉด๋ธ๋ผ์ฐ์ ์ ๋ถ์ด์์ง ์๊ณ , ํ๋ก ํธ์๋ ์๋ฒ(next.js ์๋ฒ)์ ํต์ ํ ๋ ์ฌ์ฉ๋์์ ๊ฒ๋๋ค์ด๊ฒ์ ๊ฐ์ง๊ณ ๋ธ๋ผ์ฐ์ ์ ๋ถ์ด๋ ค๋ฉด ์ธํ ์ ๋ฐ๋ก ํด์ฃผ์ ์ผ ํฉ๋๋ค๋ง์ํ์ ๋ฐฑ์๋ ์๋ฒ port:8001 ์ port:3000 ๋ธ๋ผ์ฐ์ (ํด๋ผ์ด์ธํธ) ๊ฐ ์ง์ ์ํตํ๋ ๊ฒ ์ด ์๋,next.js ์์๋ next.js server ์์ port:8001 ๋ก ์ํตํ๋ ๊ฒ์ด๊ธฐ ๋๋ฌธ์ ๋๋ค.port:8001 -> next.js server ๋ฐฑ์๋ ์๋ฒ์ ์์ฒญ ํ ๊ฒฐ๊ณผ๊ฐ ๋ฐ์์ด next.js server -> port:3001 ๋ฐ์์จ ๊ฒฐ๊ณผ๊ฐ์ผ๋ก html ๋ ๋๋ง(SSR)๊ทธ๋์ postman ์์ ์์ฒญ์์๋ Set-Cookie๊ฐ ์์ง๋งnext.js ์์๋ ์๋ฒ๊ฐ ์ค๊ฐ์ ์๊ธฐ ๋๋ฌธ์ ์ฟ ํค๋ฅผ ๋ฐ๋ก set ํด์ค์ผ ํ๋ ๊ฒ์ ๋๋ค. let setCookie = authResponse.headers.get('Set-Cookie'); console.log('set-cookie', setCookie); if (setCookie) { const parsed = cookie.parse(setCookie); cookies().set('connect.sid', parsed['connect.sid'], parsed); // ๋ธ๋ผ์ฐ์ ์ ์ฟ ํค๋ฅผ ์ฌ์ด์ฃผ๋ ๊ฒ }์ฐธ์กฐ : https://github.com/ZeroCho/next-app-router-z/blob/master/ch4/src/auth.ts#L56
- Likes
- 1
- Comments
- 3
- Viewcount
- 1.4K
Q&A
server action ๋ก๊ทธ์ธ ํ ์ฟ ํค๊ฐ ๋น์ด์์ด์
์์ธ : AUTH_URL='https://~' (https ๋ก ์์ํ๋ ๋๋ฉ์ธ์ผ๋ก ์์ฒญ)ํด๊ฒฐ : cookies ์ต์ ์ค์ (์ฌ์ง)์ฐธ๊ณ : https://next-auth.js.org/configuration/options#usesecurecookies
- Likes
- 0
- Comments
- 3
- Viewcount
- 687




