API calls and extend user DB model
-
Hi, I need to write a plugin that shows a consent form to the user, if the user accepts then I have to flag it in the database, if he declines the user will be logged out.
Is there a way to extend the current user model? If not, I think I'll go with creating a separate database table and add a hook to read from it.
Also with either option I have to make a request from the client to the server, the project documentation is kinda lacking, do I have to read the source to find the correct calls, auth config , etc? or do I need to use this https://github.com/NodeBB/nodebb-plugin-write-api?
Thanks
-
Wouldn't the solution be modifying the Terms of Use that they agree to when registering? Modifying the DB seems to be needlessly complicating things.
-
@yariplus I need to make sure they click and accept button otherwise they can't continue using the site and will be logged out; that's what the powers that be told me to do.
I haven't use NoSQL in some years now, the forums has the MongoDB backend, I suppose that if I just update the user document with an extra boolean field I can manage what I want. What's still not clear to me is how to make requests to the server, I guess I'll have to dig through the code.
Also, where do I set the Terms of Use that you speak of? I inherited this project like a week ago so I'm kind of lost.
Thx.
-
Under Settings=>User there is an option Forum terms of use.
When it is filled out, users will need to check a box when they register.