Get user by email required Admin login
-
Hi all, I want to Read user info by emails,
Even I have Auth token and header. This API still required Admin login.
Could anyone share how to Login to Nodebb using Python 3?
Or Nodebb dev team upgrade this API for using Auth token?
Thanks,
headers = {'authorization': 'Bearer %s' % auth_token,
'content-type': 'application/json'}https://docs.nodebb.org/api/read/#tag/users/paths/~1api~1user~1email~1{email}/get
Get user by email This route retrieves a user's public profile data. If the calling user is the same as the profile, then it will also return data the user elected to hide (e.g. email/fullname). Additionally, this route will only return data **if the calling user is an admin or global moderator**, or if the end user has elected to make their email public. Otherwise, it will simply return a 404 Not Found.
-
Hi @Nguyễn-Bảo!
The API call to retrieve a user by email address is actually not protected behind admin login. It is only privileged if the ACP setting to hide user email addresses is enabled:
You should be able to use an API v3 token (generated from Settings > API Access) to make this call as an administrative user, if you are not willing to change the aforementioned option.
I am not familiar with Python, but the equivalent cURL command using an API v3 token would be:
curl -H "Authorization: Bearer your_bearer_token" localhost:4567/api/user/email/[email protected]