Passport handles expected errors as exceptions #3044
Labels
Area:Backend
For server-side logic, APIs, or database functionality
Area: Code Quality
For refactoring, cleanup, or improvements to maintainability
Increasing Access
We should follow best practices for error handling.
Feature enhancement details
Our sign in with Google and Github features are not handling errors in the proper way. We are treating login failures due to invalid credentials as if they were server exceptions. These error messages should be in the third argument of the
done
callback instead of the first argument.This line is incorrect:
p5.js-web-editor/server/config/passport.js
Lines 126 to 128 in a9e518c
This line is correct:
p5.js-web-editor/server/config/passport.js
Line 53 in a9e518c
Explanation from passport documentation: (read the last paragraph)
The text was updated successfully, but these errors were encountered: