cb in express-4.x-local-example

56 views
Skip to first unread message

Ray D

unread,
Jan 10, 2017, 4:14:04 AM1/10/17
to Express

My question is Who pass the cb and what the cb exactly do?


Ryan Schmidt

unread,
Jan 10, 2017, 12:37:30 PM1/10/17
to expre...@googlegroups.com

> On Jan 10, 2017, at 03:14, Ray D <dingl...@gmail.com> wrote:
>
> I am confused with this code https://github.com/passport/express-4.x-local-example/blob/master/server.js#L14
>
> My question is Who pass the cb and what the cb exactly do?

In that code, you're defining a verify function. That verify function will be passed (from whatever code calls it--you don't need to know where) a username, a password, and a callback function that should be called when the verify function is done with its work. You don't need to know what the callback function will do, only that you must call it with the results of the verification.


Reply all
Reply to author
Forward
0 new messages