VirtusLab-Open-Source / strapi-plugin-comments

A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
MIT License
405 stars 63 forks source link

[Question] Author id based on email #141

Closed kwiat1990 closed 2 years ago

kwiat1990 commented 2 years ago

Hey, I'm still in a development phase of my project and I delete user account quite oft from different reason. What I've noticed is the fact that the ID of the user in comment plugin quals to the ID from Strapi user. As pointed out in the documentation, comment plugin doesn't expect any specific kind of author ID by making POST request and it can be really anything. Won't it better if we could decide if the ID should be matched with the ID of the Strapi user or his email?

My point is following: I can have a user, which was deleted and posted some comments. If he registers again with the same e-mail, his previous comments won't have any author because his ID in the database has change (Strapi gives him a new one). It wouldn't be a problem if comment plugin would use e-mail for the ID. In such case no matter what happend, if a user with a specific e-mail exists, comments should be linke to that user. With that it won't matter if someone log-in with Google or Facebook and it wouldn't produce the effect that user's past comments have no author.

cyp3rius commented 2 years ago

@kwiat1990 it's not a case if you're using Generic Users like the free to enter ID, but Strapi Users are associated based on relations which are built-in and how it's handled it is out of control. We don't want to be against the pattern :)

In regard to the SSO providers as far as I know Strapi anyway creates new users and associate them with social accounts, so case is going to be exact the same till the whole concept won't change.

kwiat1990 commented 2 years ago

It would be cool if one could achieve this somehow but I can understand your argumentation if that would be against the used pattern.