Calling Admin only piwigo api functions in NodeJS #440

Closed
opened 2026-10-04 23:58:39 +02:00 by adam · 1 comment
Owner

So i'm not sure why but if i call the login function for piwigo in a NodeJS script i made and then call an Admin only function for piwigo i still get 401 unauthorized even though i'm supposed to be logged in.

I am using the request library and the Q (promises) library.

The login returns {stat: "ok", "result": true} however so how am i not authorized?

So i'm not sure why but if i call the login function for piwigo in a NodeJS script i made and then call an Admin only function for piwigo i still get 401 unauthorized even though i'm supposed to be logged in. I am using the request library and the Q (promises) library. The login returns {stat: "ok", "result": true} however so how am i not authorized? <!-- github-sync-id:147279491 -->
adam closed this issue 2026-10-04 23:58:39 +02:00
Author
Owner

appearantly in the request options or defaults i have to specify {jar: true} in order for it to keep cookies.

See example 3 https://github.com/request/request#examples

@plegall this should probably be documented for those who are using nodejs.

appearantly in the request options or defaults i have to specify {jar: true} in order for it to keep cookies. See example 3 https://github.com/request/request#examples @plegall this should probably be documented for those who are using nodejs. <!-- github-comment-id:208103457 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#440