Closed umputun closed 6 years ago
site
to /login
controller.PUT /api/v1/admin/verify/{userid}?site=site-id&verified=1
to set/reset verified statusUser
struct extended with verified
flag@umputun, I've added verify check icon to comment component, but I don't see verified
flag in User struct.
For instance, I send request for verification
https://demo.remark42.com/api/v1/admin/verify/github_ef0f706a79cc24b17bbbb374cd234a691d034128?verified=1&site=remark
and get this response:
{"user":"github_ef0f706a79cc24b17bbbb374cd234a691d034128","verified":true}
But then I request comment of user github_ef0f706a79cc24b17bbbb374cd234a691d034128
and get this struct:
{
"id":"06c9cf5d-a78b-4886-9f39-65dbbfe7de72",
"pid":"5bccdac8-9825-4492-abba-4c8b854d8e68",
"text":"<p>это часть другого виджета и решение показывать count или нет на стороне того, кто этот виджет добавляет <a href=\"https://github.com/umputun/remark#counter\" rel=\"nofollow\">https://github.com/umputun/remark#counter</a></p>\n",
"orig":"это часть другого виджета и решение показывать count или нет на стороне того, кто этот виджет добавляет https://github.com/umputun/remark#counter",
"user":{
"name":"Umputun",
"id":"github_ef0f706a79cc24b17bbbb374cd234a691d034128",
"picture":"https://demo.remark42.com/api/v1/avatar/cb42ff493ade696d88a3a590f136ae9e34de7c1b.image",
"ip":"b02b9c00b7dc8c936f3acd4c6764317fecf25960",
"admin":true
},
"locator":{
"site":"remark",
"url":"https://remark42.com/demo/"
},
"score":0,
"votes":{
},
"time":"2018-06-10T16:15:55.339450054-05:00"
}
As you see there is no verified
flag in user
object. What do I do wrong?
The reason for this was lack of retroactive verified status. In other words, only new comments created for the user with verified status had this flag populated. I have added this flag to alterComments
processing response before it sent to a client and this should do it.
Now it works, thanks!
The goal is to provide a way to set/rest "Verified" status for any user. It is going to be admin-only rest call and this info will be propagated to user's token and will be part of any
user
sub-struct in responses.On UI side verified will be shown near username as some little badge and it will need a way for admin part of UI to set/reset this status.
cc @igoradamenko