Fix jwt-token
This commit is contained in:
@@ -3,7 +3,8 @@ function validateRequest(schema, source = 'body') {
|
|||||||
const dataToValidate = req[source];
|
const dataToValidate = req[source];
|
||||||
const { error, value } = schema.validate(dataToValidate, {
|
const { error, value } = schema.validate(dataToValidate, {
|
||||||
abortEarly: false,
|
abortEarly: false,
|
||||||
stripUnknown: true
|
stripUnknown: true,
|
||||||
|
convert: true // Enable type coercion (e.g., '123' -> 123)
|
||||||
});
|
});
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user