I’m using api/auth/change-password
endpoint for changing user’s password but when the current password is wrong it throws an internal error instead of validation error. I can only see validation error in server logs.
[2023-02-01 04:11:00.645] error: The provided current password is invalid
ValidationError: The provided current password is invalid
at Object.changePassword (/home/parsa/actions-runner/_work/project/node_modules/@strapi/plugin-users-permissions/server/controllers/auth.js:123:13)
at async returnBodyMiddleware (/home/parsa/actions-runner/_work/project/node_modules/@strapi/strapi/lib/services/server/compose-endpoint.js:52:18)
What I get on frontend:
{"data":null,"error":{"status":500,"name":"InternalServerError","message":"Internal Server Error"}}
I want to get a validation error on frontend