kuzzleio / kuzzle-plugin-auth-passport-local

Provide local authentication with username/password for Kuzzle
Apache License 2.0
0 stars 2 forks source link

Solve Error 500 when KuzzleUser doesn't have 'password' field' #30

Closed ghost closed 7 years ago

ghost commented 7 years ago

If you create a KuzzleUser without password, the plugin auth with local strategy crashes saying :

 error: 2017-03-27T14:07:11+02:00 [LOG:ERROR] Cannot read property 'password' of undefined
 Cannot read property 'password' of undefined
 at context.accessors.users.load.then.userObject (/home/elastic/kuzzle/kuzzle/plugins/available/kuzzle-plugin-auth-passport-local/lib/passport/strategy.js:15:105)

This PR does :