Node.js and Passport Object has no method validPassword

前端 未结 3 1914
说谎
说谎 2021-02-02 14:40

I\'m using Node.js + Express + Passport to create a simple authentication(local)

and what I\'ve reached so far that when a wrong username or password entered user is re

3条回答
  •  悲哀的现实
    2021-02-02 15:30

    Looks like you copied example from passportjs website, where Jared failed to mention how to implement it..

    On the passport js github page he has another (simpler) example; he removed validPassword method altogether (line 18):

    Example

    if (user.password != password) { return cb(null, false); }
    

    That's what I based my app on (using encryption) on top of it.

提交回复
热议问题