You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like /v1/users/reset/initiate will return a 500 error if the request body does not have an email property. It'd be better if Central returned a 400 error with a more informative message.
We saw such a request in a deployment of Central v2023.3.1. As to why the request body didn't have an email property, it looks like the Content-Type header of the request was multipart/form-data, not application/json. The following error was thrown:
InvalidInputError: SQL tag cannot be bound an undefined value.
File "/usr/odk/node_modules/slonik/dist/src/factories/createSqlTag.js", line 27, col 19, in sql
throw new errors_1.InvalidInputError('SQL tag cannot be bound an undefined value.');
File "/usr/odk/lib/util/db.js", line 218, col 12, in equals
: sql`${sql.identifier(k.split('.'))}=${obj[k]}`;
File "/usr/odk/lib/model/query/users.js", line 71, col 9, in _getSql
where ${equals(options.condition)} and actors."deletedAt" is null
File "/usr/odk/lib/model/query/users.js", line 79, col 12, in <anonymous>
maybeOne(_getSql(options.withCondition({ email }))).then(map(_unjoin));
File "/usr/odk/lib/model/container.js", line 30, col 33, in Object.module.<computed> [as getByEmail]
const result = fn(...args)(container);
File "/usr/odk/lib/resources/users.js", line 47, col 11, in <anonymous>
Users.getByEmail(body.email)
File "/usr/odk/lib/http/endpoint.js", line 159, col 26, in <anonymous>
.then((context) => resource(localContainer.with({ context }), context, request, response))
File "/usr/odk/node_modules/slonik/dist/src/factories/createSqlTag.js", in runMicrotasks
File "node:internal/process/task_queues", line 96, col 5, in processTicksAndRejections
File "/usr/odk/node_modules/slonik/dist/src/connectionMethods/transaction.js", line 22, col 24, in Object.transaction
const result = await handler(binders_1.bindTransactionConnection(log, connection, clientConfiguration, connection.connection.slonik. {snip}
File "/usr/odk/node_modules/slonik/dist/src/factories/createConnection.js", line 97, col 18, in Object.createConnection
result = await connectionHandler(connectionLog, connection, boundConnection, clientConfiguration);
The text was updated successfully, but these errors were encountered:
It looks like /v1/users/reset/initiate will return a 500 error if the request body does not have an
email
property. It'd be better if Central returned a 400 error with a more informative message.We saw such a request in a deployment of Central v2023.3.1. As to why the request body didn't have an
email
property, it looks like theContent-Type
header of the request wasmultipart/form-data
, notapplication/json
. The following error was thrown:The text was updated successfully, but these errors were encountered: