@baris You're awesome. Thanks!
Error when generating a master token on 1.15.5
-
Steps
- Went to /admin/settings/api
- Enabled HTTPS
- Clicked Create Token
- UID = 0
- Clicked Save
Update:
I was able to bypass this by first creating a token for a normal user and then a master token. -
Thanks for reporting, https://github.com/NodeBB/NodeBB/issues/9065
-
@baris said in Error when generating a master token on 1.15.5:
Thanks @baris for solving it quickly. Do you know why the following curl call returns "Forbidden" when I try to use master token from above page for this endpoint https://docs.nodebb.org/api/write.html#tag/topics/paths/~1topics~1{tid}~1tags/put.
curl -X PUT "https://forum/api/v3/topics/367/tags" -H 'Content-Type: application/json' -H 'Authorization: Bearer cd0a4d35-c5a2-4e03-94fb-c95bf6ff1a8d' -H 'Cookie: __cfduid=dae694b4b6e86d48e30425724b0534c2e1605297679; express.sid=s%3Acrh2H3AV5Z29UOdXC0uA8Nx2eiGyShkD.CfZz7WGVTF9Y5YMUlq5v1i1ObuQkD4fUP1OM4wnOS20; _csrf=F3fobS4lIe5sJFkcd5L_NfXW' --data-raw '{"tags":"visit", "_uid":"1"}'
Interestingly when i call https://forum/api/v2/topics/367/tags with same payload using a token from write api plugin it returns following but no tags get added through that too.
{"code":"ok","payload":{}}
-
-
@fais3000 can you try with fewer options?
curl -X PUT -H "Authorization..." localhost:4567/api... --data "property=value"
-
@julian said in Error when generating a master token on 1.15.5:
--data "property=value"
@julian Even with fewer options it returns the same but tags are not added on the topic.
curl -X PUT "https://forum/api/v3/topics/367/tags" -H 'Authorization: Bearer ffee84f8-2afd-4ab5-91d6-b57afa6a2025' --data "tags=visit&_uid=1"
Returns
{"status":{"code":"ok","message":"OK"},"response":{}} -
@fais3000 What if you pass in an array of tags? (e.g.
tags[]=visit
) -
@julian Seems to do the trick. Thanks for the pointer.
For others if you are passing multiple tags through curl here is a working example.
curl --location --request PUT 'https://forum.com/api/v3/topics/14/tags' --header 'Authorization: Bearer ffee84f8-2afd-4ab5-91d6-b57afa12a2025' --data-urlencode 'tags[]=visit' --data-urlencode 'tags[]=cambodia' --data-urlencode '_uid=1'