Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Support entityUsernameField override of usernameField
  • Loading branch information
adamvr committed May 23, 2017
1 parent 1d33673 commit 201ff1c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/verifier.js
Expand Up @@ -67,8 +67,12 @@ class LocalVerifier {

verify(req, username, password, done) {
debug('Checking credentials', username, password);

// Choose username field
const usernameField = this.options.entityUsernameField || this.options.usernameField;

const query = {
[this.options.usernameField]: username,
[usernameField]: username,
$limit: 1
};

Expand Down

0 comments on commit 201ff1c

Please sign in to comment.