Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds error handling for undefined/null password field in authentication-local #2444

Merged
merged 1 commit into from
Sep 12, 2021

Conversation

mohitmayank
Copy link
Contributor

Steps to reproduce the issue

  • Create a feathers app with authentication using CLI
  • Send a local auth request but without password field.

Expected behavior

Should throw 401: NotAuthenticated

Actual behavior

Following 500: GeneralError gets thrown

error: Error: Illegal arguments: undefined, string                                                                                    
    at _async (/<root>/node_modules/bcryptjs/dist/bcrypt.js:286:46)
    at /<root>/node_modules/bcryptjs/dist/bcrypt.js:307:17                                                                                             
    at new Promise (<anonymous>)                                                       
    at Object.bcrypt.compare (/<root>/node_modules/bcryptjs/dist/bcrypt.js:306:20)                                                                     
    at LocalStrategy.<anonymous> (/<root>/node_modules/@feathersjs/authentication-local/lib/strategy.js:88:53)                                         
    at Generator.next (<anonymous>)                                                    
    at /<root>/node_modules/@feathersjs/authentication-local/lib/strategy.js:8:71                                                                      
    at new Promise (<anonymous>)                                                       
    at __awaiter (/<root>/node_modules/@feathersjs/authentication-local/lib/strategy.js:4:12)                                                          
    at LocalStrategy.comparePassword (/<root>/node_modules/@feathersjs/authentication-local/lib/strategy.js:78:16)
    at LocalStrategy.<anonymous> (/<root>/node_modules/@feathersjs/authentication-local/lib/strategy.js:106:24)                                        
    at Generator.next (<anonymous>)                                                    
    at fulfilled (/<root>/node_modules/@feathersjs/authentication-local/lib/strategy.js:5:58)                                                          
    at processTicksAndRejections (internal/process/task_queues.js:97:5)  

@mohitmayank
Copy link
Contributor Author

@daffl

@daffl daffl merged commit 4323f98 into feathersjs:dove Sep 12, 2021
@daffl
Copy link
Member

daffl commented Sep 12, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants