G
G
GodOfTheMetal2016-02-11 15:55:44
Node.js
GodOfTheMetal, 2016-02-11 15:55:44

How to change the user object for the local authorization strategy in Passport.js?

An example of unmodified sources is here.
There is the following code:

var userSchema = mongoose.Schema({
    local: {
        email: String,
        password: String
    }
});

I want to change it to:
var userSchema = mongoose.Schema({
    local: {
        id: String,
        user: {
            email: String,
            password: String
        }
    }
});

Having made these changes, I get an error when trying to authorize:
node_modules\bcrypt-nodejs\bCrypt.js:642
throw "Incorrect arguments";
Renamed occurrences of the view local.emailin local.user.emailin the following files:
  1. routes.js
  2. profile.ejs
  3. user.js
  4. passport.js

Tons of blessings and love will be poured on the one who will help to get out of this forest. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Damir Makhmutov, 2014-10-17
@doodoo

Try like this?

submit="signinForm.$valid && signinCtrl.addPlayer()"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question