node-wpapi
node-wpapi copied to clipboard
How to handle authentication when using Duo Authentication?
We use Duo Authentication and disabled it for a specific user, but want to keep it for the other users.
I wasted many hours of debugging finding out why I get success response from WordPress, but the post was not being created.
It was because the JSON.parse in the try-catch with its hidden error. Maybe there should be a warning or something similar if the the response is not JSON-parsable.
How to handle authentication when using Duo Authentication?
I fixed this by using the Application Passwords plugin. That will bypass the Duo Authentication, but the error was hidden in deeply, because of the try-catch + JSON.parse.
https://github.com/WP-API/node-wpapi/blob/f4a23a958007f5b7e7381e4fd70fa62b78470bdf/superagent/superagent-transport.js#L91