Create User from Node.js Failure.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- api
Research direction
Start by reproducing the POST request to the /api/v2/users entry point with the versions and request options shown. Inspect how the write API handles the Authorization header and accessToken during user creation, then compare that path with the reported setHeader error. Done means the request either creates the user successfully or returns a clear, documented API error.
Written by the indexing model from the issue text.
Description
nodebb version 1.13.2
nodebb-plugin-write-api version 5.7.3
node.js version 12.14.1
post data:
username=Panama.City&password=12345678&email=panama.city%40domain.com
http request option:
{ hostname: 'localhost',
port: 4567,
path: '/api/v2/users',
method: 'POST',
timeout: 5000,
headers:
{ Authorization: 'Bearer <token>' } }
var req = require('http').request(options, (res) => {
let data = '';
// A chunk of data has been recieved.
res.on('data', (chunk) => {
data += chunk;
});
// The whole response has been received. Print out the result.
res.on('end', () => {
console.log(data);
var rt = JSON.parse(data);
if (callback) callback({status: 'success'});
});
req.on('error', (e) => {
if (callback) callback({status: 'failure'});
});
});
req.write(postData);
req.end();
Error: "value" required in setHeader("accessToken", value)
at validateHeader (_http_outgoing.js:492:11)
at ClientRequest.setHeader (_http_outgoing.js:501:3)
at new ClientRequest (_http_client.js:173:14)
at Object.request (http.js:38:10)
Any idea what I did wrong there? Thank you for an excellent plugin to an excellent forum platform.
- Dominant language
- JavaScript
- Stars
- 136
- Forks
- 75
- Avg merge
- 1m
- Merged PRs (30d)
- 8
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NodeBB/nodebb-plugin-write-api
-
Dependency Dashboard Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
bug
NodeBB/nodebb-plugin-write-api#130 · 1 comment · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
NodeBB/nodebb-plugin-write-api#118 · 4 comments ·
-
enhancement
NodeBB/nodebb-plugin-write-api#87 · 5 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
All issues in NodeBB/nodebb-plugin-write-api
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100