안녕하세요 질문 부탁드립니다 passport . serializeUser (( user , done ) => { //user id만 뽑아서 done 해준다 console . log ( "로그인네번째" ) // done(null, user.id); console . log ( user . id ) done ( null , user . id ); //세션에 user의 id만 저장 //done이 실행되면 auth로 간다 }); passport serialize하면 session에 id:1, 'connect.sid' .....이렇게 저장된다고 하셨는데 이렇게 id가 들어가지 않습니다 console에서 찍어보면 Executing (default): SELECT `id`, `number`, `password`, `birth`, `provider`, `gender`, `createdAt`, `updatedAt`, `deletedAt` FROM `Users` AS `User` WHERE (`User`.`deletedAt` IS NULL AND `User`.`number` = '01012341234'); 로그인세번째 1 로그인네번째 1 로그인다섯번째 POST /auth/login 200 277.213 ms - 25 id가 잘 찍히긴 합니다 왜 그런건가요? 혹시 리다이렉트 안 써서 그런건가요? 추가로 유저의 마이 페이지로 들어갈 때 세션에 있는 정보를 통해 deserialize 로 해서 유저 정보를 마이페이지에 보여주는 것 로그인 하면 마이페이지 프론트로 유저 정보 보내줘서 마이페이지 들어가면 유저 정보를 보여주게 하는 것 둘 다 가능한건가요?
넵 감사합니다 html의 정보를 axios를 통해 서버로 보낼려합니다 html에서 onclick 으로 js파일에서 유저 정보를 받습니다 그런데 html에서 script src = "https://unpkg.com/axios/dist/axios.min.js" > script > 이거 추가하면 html의 onclick이 undefined이고 npm으로 axois추가해서 js파일에서 import axios from 'axios' ; 하면 js파일의 함수들이 undefined입니다 axios를 통해 서버로 보내주는 js파일에만 type을 모듈로해서 import axios from 'axios' ; 이렇게 하면 Failed to resolve module specifier "axios". Relative references must start with either "/", "./", or "../". 이 오류가 뜹니다 어떻게 해결할 수 있을까요?
따라해봤는데 ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 8 Current database: *** NONE *** ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY 'sion1129'' at line 1 이렇게 뜹니다 감사합니다