WEB5 - Express passport.js

passport.js 세션이용

수업소개

Passport.js는 내부적으로 express-session을 이용합니다. 여기서는 두개의 미들웨어를 연결하는 방법을 알아봅니다. 

 

 

pm2, node-mon과 같은 자동 재시작 도구를 사용하는 경우 세션 정보가 저장이 안되는 현상이 발생할 수 있습니다. 이유는 sessions 디렉토리에 파일이 추가되면 node가 재시작 되기 때문입니다. 이를 해결하기 위해서 sessions 디렉토리에 대해서는 재시작을 하지 않도록 조치해야 합니다. 아래 수업을 참고해주세요. 

https://opentutorials.org/course/3332/22110

 

 

 

강의 1

 

 

 

소스코드

변경사항

 

 

 

강의 2

 

 

 

강의 3

 

 

 

소스코드

변경사항

댓글

댓글 본문
  1. johnsmith123
    Writing programming assignment is a very difficult task which makes the students very nervous. But every problem has a solution and solution of programming assignment is https://www.theacademicpapers.co.uk/
  2. 퍼스니
    app.post('/login_process',
    passport.authenticate('local'),
    function(req, res) {
    console.log(req.user);
    req.session.save(function(){
    console.log('success');
    res.redirect('/');
    })
    });

    이렇게 수정해서 무제 해결 하였습니다.
  3. 퍼스니
    app.use(session({
    resave: false,
    saveUninitialized: true,
    secret: 'sknfienf123',
    store: new FileStore()
    })
    );
    항목에서 saveUninitialized를 false로 변경해서 해결하였습니다.
  4. 퍼스니
    클론 떠서 실행해봐도 세션에 email 추가가 안되고, deserialize도 실행이 안되네요... ㅠㅠ
  5. ldhan0715
    20-09-21
  6. norton.
    Norton Antivirus does well in discovering a wide range of infections and malware. It even gives the full framework sweep or explicit organizer output of the framework. Not by any means, a solitary realized infection can make tracks in an opposite direction from norton. The association offers a splendid vary of code objectives that shield your work zones, PCs and mobile phones from the unfortunate dangerous on-line Looking Norton.com/myaccount activation steps
    <a href="http://n-norton-norton.com/">norton.com/setup</a><br>
  7. norton.
    Microsoft Office is employed by most of the people to finish their add a scientific and arranged way. Microsoft Office comes with different versions like Office 2019, Office 2016, Office 2013, and Office 365. Each Microsoft program is employed for various tasks. Each version of the Microsoft Office Setup needs a product code to finish its activation process.

    <a href="https://mynorton-com.com/">www.norton.com/setup</a>
  8. norton.
    Microsoft Office is employed by most of the people to finish their add a scientific and arranged way. Microsoft Office comes with different versions like Office 2019, Office 2016, Office 2013, and Office 365. Each Microsoft program is employed for various tasks. Each version of the Microsoft Office Setup needs a product code to finish its activation process.

    <a href="https://ww-officecom.us/">www.office.com/setup</a>
  9. norton.
    Office is operated by the users on Windows, laptops, smartphones, MacOS. The users can use Microsoft Office in anywhere they want to. just in case the users make any changes in their document online, then the changes will get synchronized. The user can purchase Office setup from both the web or offline mode.
    Click the link below to download.

    <a href="https://officecomus.us/">www.office.com/setup</a>
  10. norton.
    If you are using the internet or not on your device there always will be a need for strong antivirus to be installed to protect it against mischievous youths looking for a thrill or a hardened cyber-criminal wanting to take advantage of billion-dollar firms, can stop wanting to search out ways in which to commit fraud, cause widespread harm, or simply leak or use your personal data.
    <a href="https://nortonsetup-nortoncom.com/">norton setup</a>
  11. miajames
    https://officesetup-officecomsetup.com/
    Office 365 can be more useful than just an email application if you pick the right participation plan. For business, improving benefit and joint exertion in the affiliation has gotten imperative to make it straightforward and progressively able for the delegates to work.But, amounts of associations are so far utilizing the major plans of Office 365, which limit them from utilizing the invigorated features. Thusly, to promise you get every component and use your Office 365 enrollment to the most.
    Buy your Office from Official http://www.office.com/setup
    https://officesetup-officecomsetup.com/
  12. miajames
    https://get-officecom.com
    Office 365 can be more useful than just an email application if you pick the right subscription plan. For business, enhancing productivity and collaboration in the organization has become necessary to make it easy and more proficient for the employees to work.But, numbers of businesses are still utilizing the basic plans of Office 365, which limit them from utilizing the updated features. So, to ensure you get every feature and use your Office 365 subscription to the most.
    https://get-officecom.com
  13. 뚜루뚜루뚭
    감사합니다
  14. 쑤우
    수강완료. 감사합니다~
  15. Mark Wilson
  16. pythondevs
    Have you heard about pythondevs.org? They have the best python developers for web and mobile development.

    https://pythondevs.org/
  17. Are you looking for protection against bot? Then visit websecureservices.com, They are known to provide the best protection against bots.
    https://websecureservices.com/
  18. Are you looking for protection against bot? Then visit websecureservices.com, They are known to provide the best protection against bots.
    https://websecureservices.com/
  19. Are you looking for protection against bot? Then visit websecureservices.com, They are known to provide the best protection against bots.
    https://websecureservices.com/
  20. Are you looking for protection against bot? Then visit websecureservices.com, They are known to provide the best protection against bots.
    https://websecureservices.com/
  21. Are you looking for protection against bot? Then visit websecureservices.com, They are known to provide the best protection against bots.
  22. norton setup
    Norton com/setup - For Downloading, Installing and activating the Norton product, visit www norton.com/setup and Get Started with Norton Antivirus at norton com/setup. http://com-norton.com/
  23. Office.com/setup
    I suppose this is a case study, more or less, just about what a self-sufficient resource can do armed with Project Management Experience, Microsoft Project, MS Excel and some of VBA encoding. https://officesetup.support/
  24. www.webroot.com/safe
    Activate webroot antivirus

    Go to webroot safe site http://www.webroot.com/safe or webroot.com/safe from your program.
    Sign in Webroot account with your Credentials.
    Enter your Webroot Key code have 20 digits.
    Snap on Next catch to enroll your Webroot item.
    Acknowledge the Agree and Install catch to continue.
    At long last your Webroot safe is enacted effectively.
    visit:
    https://webrootcom-webroot.com/safe
  25. norton.com/setup
    norton antivirus is the best antivirus which protect your
    system from all kind of online threats such as virus,
    malware and spyware.You can download norton.com/setup from norton official website to ensure your system security.

    https://new-norton.com
  26. norton.com/setup
    norton antivirus is the best antivirus which protect your
    system from all kind of online threats such as virus,
    malware and spyware.You can download norton.com/setup from norton official website to ensure your system security.

    https://new-norton.com
  27. norton.com/setup
    norton antivirus is the best antivirus which protect your
    system from all kind of online threats such as virus,
    malware and spyware.You can download norton.com/setup from norton official website to ensure your system security.

    https://new-norton.com
  28. norton.com/setup
    norton antivirus is the best antivirus which protect your
    system from all kind of online threats such as virus,
    malware and spyware.You can download norton.com/setup from norton official website to ensure your system security.

    https://new-norton.com
  29. office.com/setup
    Get started with your Microsoft Office Installation you must need valid product key code and follow the instructions to complete the process.if you have any query related to office setup then contact now.
    https://wwwoffice-office.com
  30. tomwick090
    Excellent blog! This blog is extremely useful to get the simple tips to install McAFee antivirus software using <a href="https://mymcafeecomactivate.com/">mcafee.com/activate</a>. These tips are useful for installing the antivirus program. I am very happy with you. Thanks a lot for this important blog.
  31. Norton.com/setup
    I am very satisfied with Norton anti-virus. It offers good protection on all types of
    devices. The price/quality ratio is huge, especially since there are regular
    promotions. The website is clear and easy to navigate. I highly
    recommend it.You can follow this site.
    https://mynorton-com.com/setup
  32. Johnny Potter
    Nice one! thank you so much! Thank you for sharing this post.
    https://go-trendmicro.com
    https://help-trendmicro.com
    https://helpavast.com
  33. gomcafeeactivate@gmail.com
    McAfee Activate at mcafee/activate, enter your product key for https://gomcafeeactivate.com online. Get Started with McAfee Activation.
  34. pbs.org/activate
    PBS for grown-ups is Meant for the parents of Their <a href="https://www.pbsorgactivate.com">pbs.org/activate</a>.
    Parenting is. PBS for grownups attempts to inculcate parenting to PBS Kids' parents. Parents are educated about the methods of bringing their children up, organize for their child's birthday parties and more. PBS to get grown-ups has substances which enhance the teachers' abilities and improve.
  35. delainey34
    Our tech expert is very experienced and proficient to solve all your queries and issue regarding Mcafee antivirus products. To take appropriate action, security software must be used to equip their devices. If you have any kind of issues, please contact us.
    <a href="http://www-mcafeeactivate.us">mcafee.com/activate</a>
  36. Trend Micro login
  37. 굼벵이
    완료
  38. victorjames2303
    Thanks for sharing this post, this is really very nice informative post.
    I will regularly follow your blog

    http://usetupnorton.com/
  39. 인걸
    deserialize 함수가 호출 안되는 문제

    1. CORS 허용
    2. 라우트 세션에서
    cookie: {
    secure: false
    }
    둘 중 다 하거나 하나를 해서 해결
  40. node짱짱
    여보세요! 간단히 말해서이 게시물에 대한 좋은 정보를 얻기 위해 엄청난 엄지 손가락을주고 싶습니다. 더 빨리 블로그에 다시 올 것 같습니다. Regards :- https://nortonsetup-key.com | http://msofficesetup.org | http://mymcafeeactivate.com
  41. 난마돌
    passport를 가장 잘 설명해주는 강의같습니다 . 최고!
  42. Specialist
    어제 밤에 deserialize 호출되는건 해결했습니다.
    https://opentutorials.org......134 에 예전 passport강의가 있길래 봤는데 댓글을 보니까 저와 비슷한 문제를 겪으신 분들이 많아서 그거 참고해서 deserialize는 나오게 했어요.
  43. 어떻게 도와드려야할지...deserialize 함수가 호출은 되고 있나요?
    대화보기
    • Specialist
      도와주세요... 저는 deserialize 부분의 console.log가 안나와요. 로그인 버튼 누르면 deserialize까지 같이 나와야 하잖아요. 근데 계속 안나와요 뭐가 문제인지 모르곘어요!! 도와주세요!!
    • Specialist
      이걸 8시간 째 하고 있는데도 안되네요... 진짜 미쳐버리겠네...
    • 세션에 저장하는건 문제가 안되는데 세션에 저장하기도 전에 redirect를 해서 그렇습니다.
      대화보기
      • jo_onc
        저도 오늘 다시 확인해보니 세션이 저장될 때가 있고 안 될때가 있고..
        왜 이럴까요?
        vscode, pm2 사용하는데, 제 PC의 문제일까요?
        대화보기
        • jo_onc
          pm2 start main.js --watch --ignore-watch="data/* sessions/*" --no-daemon
          적용해봐도, 로그인 후 갱신을 한 번 더 해야만 로그인 표시가 되네요..
          해결방법 아시는 분 계신가요?
          vscode, pm2 사용하고 있습니다.
        • nodejs + passport.js + cluster + mongodb 사용중인데
          클러스터 다른 worker로 바뀔때마다 로그인 풀려서

          connect-mongo 사용해서 해결했습니다.
        • 후루룽
          조금 어렵지만 흥미진진!! 감동적이에요
        버전 관리
        egoing
        현재 버전
        선택 버전
        graphittie 자세히 보기