u/prodcoderin r/node • Recommends
Sessions in Node #5 | Authentication in Node.js with Express and sessions | refactoring codebase
13K subscribers • 7 videos on Hallway
Intermediate. Assumes working knowledge.
4.6K views6 years ago1 recommendation
Web developmentSoftware designNode.js, Deno and BunRefactoring and legacy codeSoftware architecture
Jan Goebel demonstrates how to refactor an Express and Redis session authentication codebase by splitting logic into controllers and middleware.
🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: twitter.com/_jgoebel Blog: productioncoder.com Code: github.com/productioncoder/express-session-with-redis Learn how to build a cookie and session-based authentication system with the Node express.js framework and the Redis in memory store. This part 5 of our series in which we continue refactoring our already working application so split functionality over multiple files. - rationale for moving request handling to controller - moving login logic to authentication controller - wiring up authentication controller in routes file - moving protected route request handling to a controller - moving session middleware to a separate file - move connect-redis to our session middleware - move redis client to its own file - wiring up redis client with express-session middleware - wiring up session middleware with express server - cleaning up main index.js fileu/prodcoderin r/node • Recommends