message: properly accessing db results
diff: @@ -39,11 +39,11 @@ export async function validateToken(token: string): Promise<User> {
  const query = 'SELECT token, user_id FROM reset_password_token WHERE token = ? AND expires_at > ?';
  const result = await db.raw(query, [token, Math.floor(Date.now() / 1000)]);
  - if (result.length !== 1) {
  + if (result[0].length !== 1) {
  throw new BadRequest ('Failed to validate token');
  } else {
  await db.raw('DELETE FROM reset_password_token WHERE token = ?', [token]);
  - return principalService.findById(result[0].user_id) as Promise<User>;
  + return principalService.findById(result[0][0].user_id) as Promise<User>;
  }
  }
  