Custom registration. Custom API or middleware?

System Information
  • Strapi Version: 4.10.5
  • Operating System: Windows 10
  • Database: better-sqlite3 ???
  • Node Version: v16.18.1
  • Yarn Version: 1.22.19

I want to make a dating site for men and women. I have created 2 different collections in Strapi, one for men, another for women because they have different required fields at registration and further. How do i send data to Woman/Man collection type and to User at the same time?

In your middleware, on registration, you can intercept the request and populate your collections using the entity service.

Please be more specific. There is so much information on different middlewares. In what folder do i create which file (name of the file)?

I cannot be more specific as you’ve provided no code. We can’t just provide solutions to high-level concepts.

I recommend you read the docs

export default async (req, res) => {
  const { password, email, name } = req.body

  try {
    const response = await
        username: email,

    setCookie({ res }, 'jwt',, {
      httpOnly: true,
      secure: process.env.NODE_ENV !== 'development',
      maxAge: 30 * 24 * 60 * 60,
      path: '/',

  } catch (e) {

Could not understand what to write where.

This does not help. No such directories

This does not work with User collection type(

My code: GitHub - tacticSugar/linxas