It is impossible to generate a unique slug for the same string.
I have been using Strapi since v3 and it worked perfectly there. I started with the same thought that the username for my each user would be unique. But turns out when using social providers such as google login, this fails and I can have multiple people with the same username.
So I turned to a slug based system slug connected to name of the person.
I am using REST API to add content and Strapi surprised me again by not returning the slug generated via API (even though I can see it in the Dashboard).
So I turned to strapi-plugin-slugify. This plugin too can not help with unique generation of slug for same name (even with slugifyWithCount set to true).
I am finding it incredibly difficult to make a slug system work in Strapi v4. All of this worked seamlessly in Strapi v3. I had to resort to an ugly slug system where the slug is a random string generated by frontend.
Can anyone please point me in the right direction? I may be wrong as it shouldn’t be this tough to make a unique slug for the name of the users. Any help is appreciated!
- Strapi Version: 4.3.8
- Operating System: Ubuntu 22.04
- Database: SQLite
- Node Version: v16.0.0
- NPM Version: 7.10.0
- Yarn Version: 1.22.15