not saying this is case closed but after a lot (and i mean a lot, basically about 3.5hrs) of debugging, trial and error, I changed backend/src/api/verification-token/controllers/verification-token.ts from
/**
* verification-token controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::verification-token.verification-token');
to:
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::verification-token.verification-token', ({ strapi }) => ({
async findOne(ctx) {
const { id } = ctx.params;
console.log(`Fetching token with id: ${id}`);
const entity = await strapi.entityService.findOne('api::verification-token.verification-token', id);
if (!entity) {
console.log(`Token with id ${id} not found`);
return ctx.notFound('Token not found');
}
console.log(`Token found: ${JSON.stringify(entity)}`);
ctx.body = entity;
},
}));
and now findOne works completely as expected.