Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verified status for users #60

Closed
umputun opened this issue May 30, 2018 · 4 comments
Closed

Verified status for users #60

umputun opened this issue May 30, 2018 · 4 comments

Comments

@umputun
Copy link
Owner

umputun commented May 30, 2018

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

@umputun
Copy link
Owner Author

umputun commented May 30, 2018

  1. in order to support verified status via auth/jwt we need info about the site. I have added an optional parameter site to /login controller.
  2. New method PUT /api/v1/admin/verify/{userid}?site=site-id&verified=1 to set/reset verified status
  3. User struct extended with verified flag

@umputun umputun added this to the v1.0.0 milestone May 31, 2018
@igoradamenko
Copy link
Collaborator

igoradamenko commented Jun 11, 2018

@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?

@igoradamenko igoradamenko reopened this Jun 11, 2018
@umputun
Copy link
Owner Author

umputun commented Jun 11, 2018

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.

@igoradamenko
Copy link
Collaborator

Now it works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants