Settings

Theme

Show HN: Async/Await example for passport.js and express.js

wlaurance.com

2 points by wlaurance 7 years ago · 1 comment

Reader

wlauranceOP 7 years ago

I've been deep in the weeds building out a course. Today I wanted to share a snippet of building out an express + passport auth scheme using the latest async/await patterns. It's really nice to not be in callback hell. Even though passport mostly uses callbacks we can still do our app-specific code like looking up a user by email, de-serialization, and serialization in an async function if desired.

I have an email signup if you want to get the full working code same.

Thanks!

Will

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection