Skip to content

Usernamequeryfields not inspected on calling register function #361

@olawalejuwonm

Description

@olawalejuwonm

I have my user model setup to allow either one or two fields (email and phoneNumber) as username (both can be provided) the order of priority is set to be email so i passed usernameField: 'email', and usernameQueryFields: ['userCode'], options. But on calling the register function with only phoneNumber, passport local mongoose throws missingUserName error because it only check for userNameField as shown in the snippet below:
image

It doesn't check for usernameQueryFields

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions