LBRY Block Explorer

LBRY Claims • 03-set-up-passport-advanced-node-and

e0b366d23506ef13d3ab4011679cbe0ce0ec3721

Published By
Anonymous
Created On
25 Jun 2021 17:21:27 UTC
Transaction ID
Cost
Safe for Work
Free
Yes
03 - Set up Passport - Advanced Node and Express - freeCodeCamp
We need to set up some node modules to store cookies for our sessions (express-session) and for authentication (passport). We have to mount these as middlewares for all routes.<br /><br />Link to Challenge : <a href="https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/set-up-passport" target="_blank" rel="nofollow">https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/set-up-passport</a><br />Written Guide: <a href="https://www.notion.so/ganeshh123/Set-up-Passport-ac75ec24dd0d417492be86a5049d6ba5" target="_blank" rel="nofollow">https://www.notion.so/ganeshh123/Set-up-Passport-ac75ec24dd0d417492be86a5049d6ba5</a><br /><br />Full Playlist for this course : <a href="https://www.youtube.com/playlist?list=PLhGp6N0DI_1RL9djhgSH65pZhJ6xSyKX8" target="_blank" rel="nofollow">https://www.youtube.com/playlist?list=PLhGp6N0DI_1RL9djhgSH65pZhJ6xSyKX8</a><br />All Writen Guides for this course : <a href="https://www.notion.so/ganeshh123/ccf6039186334f83a54c1c9216f30e3c" target="_blank" rel="nofollow">https://www.notion.so/ganeshh123/ccf6039186334f83a54c1c9216f30e3c</a><br />All My Tutorials can be found at : <a href="https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26" target="_blank" rel="nofollow">https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26</a><br /><br />00:00 - Introduction<br />00:32 - Express Session Setup - session()<br /><a href="https://www.npmjs.com/package/express-session#sessionoptions" target="_blank" rel="nofollow">https://www.npmjs.com/package/express-session#sessionoptions</a><br />03:32 - How Session Storage Works<br />06:20 - Passport Setup<br />passport.initialize()<br />Returns a middleware which must be called at the start of connect or express based apps. This sets req._passport, which passport uses all over the place.<br /><a href="https://github.com/jwalton/passport-api-docs#passportinitialize" target="_blank" rel="nofollow">https://github.com/jwalton/passport-api-docs#passportinitialize</a><br />passport.session()<br />"If your application uses persistent login sessions, passport.session() middleware must also be used." Should be after your session middleware. This returns a middleware which will try to read a user out of the session; if one is there, it will store the user in req.user, if not, it will do nothing.<br /><a href="https://github.com/jwalton/passport-api-docs#passportsessionoptions" target="_blank" rel="nofollow">https://github.com/jwalton/passport-api-docs#passportsessionoptions</a><br />08:07 - Challenge Solution<br /><br />-————————————————————————————————————-<br />Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside a web browser. Node.js lets developers use JavaScript to write command line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser. <br /><br />Express.js, or simply Express, is a web application framework for Node.js. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js. Express runs between the server created by Node.js and the frontend pages of a web application. Express also handles an application's routing.<br /><br />freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs<br />...<br /><a href="https://www.youtube.com/watch?v=9bqziIplOwI" target="_blank" rel="nofollow">https://www.youtube.com/watch?v=9bqziIplOwI</a>
Author
Content Type
Unspecified
video/mp4
Language
English
Open in LBRY