Custom Joi Validation for JWT Tokens #115
huzaifa-99
started this conversation in
General
Replies: 1 comment 1 reply
-
@huzaifa-99 thanks for the idea. Would you like to do a PR on it? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @hagopj13. I have been using the boilerplate for some time and have been really enjoying it.
Regarding the Joi Validation. The boilerplate requires the user to send JWT tokens either with req.body or req.query for some routes like
auth/reset-password
orauth/logout
, but they are not validated to have a basic JWT structure. For example:token=abc
will pass the validation.In contrast, we do this type of validation for a valid mongo id in custom.validation.js. A custom validation method can be added in custom.validation.js for validating JWT.
Beta Was this translation helpful? Give feedback.
All reactions