172만명의 커뮤니티!! 함께 토론해봐요.
미해결
[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
안녕하세요. 리프레쉬 토큰을 사용하여 useAuth에 적용을 했는데요. 로그인을 하여 리프레쉬 토큰이 발급 되어도 조건에 만족하지 못하고 있습니다. 확인해보니 restoreAccessToken을 가져오지 못하여 발생하는 이벤트 였습니다. 하지만 새로고침을 하면 리프레시 토큰을 찾아서 인증이 됩니다. 무슨 이유 때문인지 잘 모르겠습니다. 리프레시 토큰 코드도 첨부하도록 하겠습니다. 추가적으로 로그인 인증시 getAccessToken을 직접 불러오면 문제가 없지만 리코일로더블로 이용하면 이런 문제가 생깁니다.!!
react node.js seo graphql next.js
김태연
2024-03-26T13:39:01.234Z
댓글 1
좋아요 0
조회수 350
미해결
Next + React Query로 SNS 서비스 만들기
signOut({ redirect: false }).then(() => { fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/logout`, { method: "post", credentials: "include", }); router.refresh(); router.replace("/"); }); 로그아웃 버튼에 `router.refresh()`를 추가하면 로그아웃 버튼을 누르고 다시 로그인했을 때 기존 정보의 캐시가 삭제되고 새로 갱신된다고 하셨는데 저 코드를 추가해도 기존 정보가 계속 남아있는 경우는 어디를 확인해봐야 할까요? 브라우저에서 캐시 지우고 새로고침, 브라우저 창 재시작, 서버 껐다 켜기를 해봤는데도 계속 이전 정보가 남아있습니다..
react next.js react-query next-auth msw
이우열
2024-03-26T10:49:22.441Z
댓글 3
좋아요 0
조회수 492
미해결
따라하며 배우는 리액트 A-Z[19버전 반영]
예전 질문글처럼처음부터 다시 설치해봐도 해결이 안되어 질문을 올립니다.
react redux tdd typescript next.js 소프트웨어-테스트
오징어
2024-03-26T09:01:50.132Z
댓글 1
좋아요 0
조회수 352
해결됨
[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" href="./css/index.css"> </head> <body> <div class="wrapper"> <div class="main"> <div class="detail"> <div class="detail1">회원가입을 위해<br> 정보를 입력해주세요</div> <div class="detail2"> <input type="text" class="box" placeholder="* 이메일"> </div> <div class="detail3"> <input type="text" class="box" placeholder="* 이름"> </div> <div class="detail4"> <input type="password" class="box" placeholder="* 비밀번호"> </div> <div class="detail5"> <input type="password" class="box" placeholder="* 비밀번호 확인"> </div> <div class="gender"> <div> <input type="radio" name="gender">여성 </div> <div> <input type="radio" name="gender">남성 </div> </div> <div class="checkbox"> <input type="checkbox">이용약관 개인정보 수집 및, 마케팅 활용 선택에 모두 동의합니다. </div> <div class="line"></div> <div class="join"> <button>가입하기</button> </div> </div> </div> </div> </div> </body> </html> * { box-sizing: border-box; margin: 0px; } html,body { width: 100%; height: 100%; } .wrapper { width: 1920px; height: 1080px; display: flex; flex-direction: row; align-items: center; justify-content: center; } .main { width: 670px; height: 960px; border-radius: 20px; border: 1px solid #AACDFF; display: flex; flex-direction: row; align-items: center; justify-content: center; box-shadow: 7px 7px 39px 0px #0068FF40; } .detail { width: 470px; height: 818px; display: flex; flex-direction: column; align-items: center; } .detail1 { width: 466px; height: 94px; font: 700; font-size: 32px; color: #0068FF; } .detail2 { width: 466px; height: 80px; color: #797979; border-bottom: 1px solid #0068FF; } .detail3 { width: 466px; height: 80px; color: #797979; border-bottom: 1px solid #797979; } .detail4 { width: 466px; height: 80px; color: #797979; border-bottom: 1px solid #797979; } .detail5 { width: 466px; height: 80px; color: #797979; border-bottom: 1px solid #797979; margin-bottom: 20px; } .box { border: none; padding-top: 30px; } .gender { width: 140px; height: 23.94px; border: none; display: flex; flex-direction: row; justify-content: space-between; margin: 20px; } .checkbox { width: 454px; height: 21.06px; display: flex; flex-direction: row; justify-content: center;; font-size: 15px; margin: 30px; } .line { width: 470px; height: 1px; color: #E6E6E6; border: 1px solid #E6E6E6; margin: 20px; } .join { width: 470px; height: 75px; border: 1px solid #0068FF; border-radius: 10px; display: flex; justify-content: center; margin: 20px; } button { border: none; background-color: white; color: #0068FF; } 생긴건 비슷하게 만들었는데 가입하기가 안 눌리는 것 같아요ㅠㅠ 이메일,이름 등 인풋도 밑줄에 맞게 써지지도 않습니다 ㅠㅠ
react node.js seo graphql next.js
이승헌
2024-03-26T02:40:36.577Z
댓글 2
좋아요 0
조회수 265
해결됨
코딩테스트 [ ALL IN ONE ]
구글폼으로 작성하였습니다.
2024-03-25T15:12:05.066Z
댓글 1
좋아요 2
조회수 289
미해결
Next + React Query로 SNS 서비스 만들기
현재 상태는 201로 불러와도 redirect가 되지 않습니다. console.log()로 찍어보니 await signIn 이후로는 console.log()가 찍히지가 않았습니다. axios로 바꿔봐도 그대로이고 버전도 @auth/core 버전도 바꿔보았는데 꿈쩍 않습니다 ㅠ 물론 DB에도 정상적으로 데이터가 저장되고요.. 시간만 날리다가 도저히 안되겠기에 질문 남깁니다.. signup.ts "use server"; import { signIn } from "@/auth"; import { redirect } from "next/navigation"; // import axios from "axios"; export default async (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" }; } shouldRedirect = true; await signIn("credentials", { username: formData.get('id'), password: formData.get('password'), redirect: false, }) } catch (err) { console.error(err); return {message : null}; } console.log("11") if (shouldRedirect) { console.log("리다이랙트"); redirect("/home"); } return { message: null}; };
react next.js react-query next-auth msw
Jinhye Kim
2024-03-25T13:13:26.173Z
댓글 2
좋아요 0
조회수 448
미해결
Next + React Query로 SNS 서비스 만들기
https://github.com/nextauthjs/next-auth/discussions/10399#discussion-6417675 next-auth 쪽에도 help 쪽에 질의를 해놨는데요, 원래 이슈로 쓰려했는데 reproduce url을 요구하더라구요 ㅠㅠ 현재 auth는 이슈가 적다고 하신 라이브러리를 쓰고있어요 "@auth/core": "^0.27.0", "next": "14.0.4", "next-auth": "^5.0.0-beta.11", 를 사용중이고요, custom login 페이지를 두었는데 credentials 정보는 잘 넘어와서 login api 도 잘 타는데 그 내용을 토대로 클라이언트에서 useSession으로 유저 정보를 확인하려해도 name 만 정상적으로 리턴이되네요.. 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: "/login", }, providers: [ CredentialsProvider({ async authorize(credentials) { console.log( "credentials info: " + credentials.email + " " + credentials.password ); const params = new URLSearchParams( `empNo=${credentials.email}&empPassword=${credentials.password}` ); console.log(params); const authResponse = await fetch( `http://?????:9080/api/getempinfo`, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded", }, body: params, } ); if (!authResponse.ok) { return null; } const user = await authResponse.json(); console.log("user", user); // user.retData[0] inside informations are all string. // { // user_id: '*******', // user_name: 'jinyoung', // sert_num: '*********', // user_rgst_patr_code: '001', // rdp_code: '000' // } console.log("user.retdata.user_id =", user.retData[0].user_id); console.log( "user.retdata.user_name=", user.retData[0].user_name ); const id = user.retData[0].user_id; return { // mapping info // id?: string // name?: string | null // email?: string | null // image?: string | null id: id, name: user.retData[0].user_name, ...user.retData[0], }; }, }), ], // secret: , trustHost: true, }); 아래는 useSession 을 사용하는 클라이언트 컴포넌트에요 "use client"; import React, { useEffect, useState } from "react"; ... // import useSWR from "swr"; import { useSession } from "next-auth/react"; ... const Home = () => { const { data: session, status } = useSession(); console.log("status?"); console.log("status=" + status); console.log("session="); console.log(session?.user); useEffect(() => { if (session) { console.log("session useEffected = "); console.log(session); } }, [session]); 아래는 콘솔 찍어본 내용이에요
danroom85
2024-03-25T11:40:58.241Z
댓글 2
좋아요 0
조회수 323
미해결
Next + React Query로 SNS 서비스 만들기
넥스트에서 로그인시 해당유저의 role에 따라 분기를 나눌려면 어떠한 방식을 사용해야할까요? 로그인된 유저의 role은 student, teacher, admin 세가지의 값이 있으며 유저는 유저페이지만 선생은 선생페이지만 어드민은 어드민페이지만 따로 보여주는 방식이 있나요? 폴더구조는 이러합니다. (afterLogin) - (admin) - (teacher) - (student) (beforeLogin) - ...
react next.js react-query next-auth msw
무지55
2024-03-25T09:34:36.224Z
댓글 1
좋아요 0
조회수 276
해결됨
[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
자잘하게 궁금한게 있으면 여러방식으로 직접해보고는 하는데요 아래의 코드처럼 {...["a", "b", "c"]} 이렇게 props를 전달했을 때 console에는 {0: "a", 1: "b", 2: "c"} 이렇게 없던 배열값의 키값이 생겼습니다. 짐작하기로는 index 위치가 key값이 된 것 같기는 한데 왜 이렇게 되는지 궁금합니다. ex) parent/index.tsx import Child from "./child/index.tsx"; export default function Parent(): JSX.Element { return <Child {...["a", "b", "c"]} />; } ex) parent/child/index.tsx export default function Child(props: any): JSX.Element { console.log(props); // {0: "a", 1: "b", 2: "c"} return <></>; }
joka
2024-03-25T08:49:19.835Z
댓글 1
좋아요 0
조회수 177
해결됨
핵 of 핵 파이썬 기초 문법
1강 파이썬 프로그래밍 환경 설치 및 설정하기로 되어 있고 이어서 해보겠다라고 하는데, 환경 설치 및 설정 내용이 없습니다. 의도하신 내용이신지요?
김정수
2024-03-25T06:35:48.591Z
댓글 1
좋아요 0
조회수 268
해결됨
[리뉴얼] React로 NodeBird SNS 만들기
// posts.js router.get("/", async (req, res, next) => { // GET /posts console.log(Comment); try { const posts = await Post.findAll({ limit: 10, order: [["createdAt", "DESC"]], include: [ { model: User, attributes: ["id", "nickname"], }, { model: Image, }, { model: Comment, include: [ { model: User, attributes: ["id", "nickname"], }, ], }, ], }); res.status(200).json(posts); } catch (error) { console.error(error); next(error); } }); module.exports = router; LOAD_POST_REQUEST 액션이 dispatch돼서 api 요청을 통해 data를 받아오면 data안에 Comments의 값이 Comments 테이블에 들어있는 값이 들어있을 것으로 예상이 되는데 빈배열인 상황입니다. 혹시 다른 살펴볼만한 곳이 있는지 알려주시면 감사하겠습니다. 감사합니다.
react redux node.js express next.js
쾌할한 전복
2024-03-24T16:19:43.318Z
댓글 2
좋아요 0
조회수 283
미해결
Next + React Query로 SNS 서비스 만들기
message페이지 수정하기편에서 queryClient.prefetchQuery를 사용했는데 다른 컴포넌트에서 queryClient. prefetchQuery를 사용할때는 HydrationBoundary컴포넌트로 감싸고 state에 fetching 해온 데이터를 주입시켜서 사용했는데 여기서는 왜 아무곳에서도 사용하고 있지 않은건지 궁금합니다. 그리고 HydrationBoundary컴포넌트로 감싸고 state에 fetching해온 데이터를 주입시켜서 사용하고 있는곳들도 자식 컴포넌트에서 또 useQuery를 사용하는데 부모 HydrationBoundary에 접근해서 데이터를 사용하지 않고 useQuery로 fetching해와서 사용하는건지 궁금합니다. 저는 여태 HydrationBoundary가 fetching해온 데이터를 공유해주는 ContextAPI같은 컴포넌트라고 생각했었습니다. 자식컴포넌트에서 일일이 useQuery로 데이터를 가져오는거면 상위에 HydrationBoundary컴포넌트 안만들어줘도 되는거 아닌가요?
react next.js react-query next-auth msw
라푼젤
2024-03-23T19:02:06.996Z
댓글 1
좋아요 0
조회수 582
미해결
[개정판] 파이썬 머신러닝 완벽 가이드
안녕하십니까 교수님. 사이킷런 업그레이드 수행 및 XGBoost와 LightGBM 설치 강의를 듣는 중 영상이 윈도우에 초점이 되어있는데 저는 mac os를 쓰고 있습니다. 1:19초부터 진도를 못따라가겠는데 mac 용 설치방법 영상이나 가이드는 따로 없을까요?
spah853
2024-03-23T13:22:08.408Z
댓글 2
좋아요 0
조회수 766
미해결
궁금한게 저기서 i와 j가 동일한 행을 뽑고 싶은데 해당하는 df전체 열을 뽑고 싶으면 코드를 어떻게 짜야할까요? 도와주세요..
newtjsdud
2024-03-22T07:09:49.759Z
댓글 3
좋아요 1
조회수 356
미해결
파이썬으로 영화 예매 오픈 알리미 만들기
안녕하세요. 인프런 강의에 푹빠져서 여기까지 오게 된 사람입니다. http://www.cgv.co.kr/common/showtimes/iframeTheater.aspx?areacode=01&theatercode=0013&date=20240322 지금 보여주는 링크는 requests로 페이지 정보 가져오기에서 CGV 용상아이파크몰 상영시간표를 가져오는 것인데 iframe의 주소를 가져오면 하얀 화면만 나오고 아무것도 안나옵니다. 이럴 경우 어떻게 해야하는지 알고싶습니다. 도움을 좀 주셨으면 합니다. 감사합니다.
동철김
2024-03-22T06:11:54.385Z
댓글 1
좋아요 0
조회수 604
미해결
Next + React Query로 SNS 서비스 만들기
msw에서 DB를 연결해서 사용하고싶습니다.몽고디비를 연결하고싶은데 타입스크립트를 잘 몰라서 연결을 못하겠습니다 ... 구글 찾아봐도 잘 안나오는데 혹시 방법이 있을까요 ?
react next.js react-query next-auth msw
박진섭
2024-03-22T02:05:59.206Z
댓글 1
좋아요 0
조회수 286
미해결
[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
안녕하세요. 중고마켓 리스트를 무한스크롤로 구현 중에 있는데요. 부모 요소를 감싸서 overflow로 스크롤을 주면 height값이 먹혀서 데이터를 20개 가져오고 나서는 더이상 스크롤을 내릴 수가 없네요. 이건 ListWrap인 스크롤 컴포넌트의 부모요소를 없앨때 이구요. 이건 ListWrap을 넣었을 때 저렇게 값이 나옵니다. 어떻게 해야할까요? 아니면 무한스크롤은 아래처럼 overflowscroll을 넣고 구현이 안되는건가요?
react node.js seo graphql next.js
2024-03-21T22:28:32.103Z
댓글 1
좋아요 0
조회수 410
미해결
Next + React Query로 SNS 서비스 만들기
next: { tags: {'posts', id} } nextjs에서의 위의 코드는 nextjs의 캐시를 하는거라면 nextjs는 서버캐시를 하고 react-query는 클라이언트 캐시를 해주는건가요? 둘 다 중복적으로 캐시를 지원해주거 맞죠? 헷갈리네요
react next.js react-query next-auth msw
라푼젤
2024-03-21T15:01:18.929Z
댓글 1
좋아요 0
조회수 455
해결됨
[리뉴얼] React로 NodeBird SNS 만들기
안녕하세요 제로초님, 로컬상에서 mysql workbench 처럼 ec2인스턴스 ubuntu내에 있는 mysql db 데이터들을 시각화해서 관리할 수 있는 툴 같은 건 혹시 없을까요? 데이터들을 수정하고 싶을때 query문으로 직접 관리하는 것이 일반적인지 문의드립니다!
react redux node.js express next.js
do wang
2024-03-21T08:29:46.794Z
댓글 1
좋아요 0
조회수 207
해결됨
[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
안녕하세요 자바스크립트 배열 중에 email split 따라하면서 콘솔에 있는 내용 복사해서 vb Code에 붙혀 넣고 주석처리 했습니다. 근데 주석 뒤에 "codecamp": Unknown word. 라고 나타납니다. 이건 왜 그런가요?
react node.js seo graphql next.js
베이직
2024-03-21T04:15:17.170Z
댓글 2
좋아요 0
조회수 217