solid-node-client icon indicating copy to clipboard operation
solid-node-client copied to clipboard

Crashes with a null cookie

Open CxRes opened this issue 4 years ago • 4 comments

When I try to use solid-node-client in a nwjs environment, inside SolidNodeClient.prototype._getAuthFetcher, the cookie is set to null and then the program crashes since getAuthFetcher() expects a cookie to have length property. This might be a bug in solid-auth-fetcher and/or this call should exist in try catch block (in case authentication fails, though I am not sure why it would fail!).

Strangely, it works fine when I run the same code in Node LTS! I am not sure what trips the code up, I would appreciate any suggestions where to look...

CxRes avatar Dec 02 '20 16:12 CxRes

This actually seems identical to #10. (Should have read more carefully)

CxRes avatar Dec 02 '20 16:12 CxRes

Some more info... I get the following response from the fetch inside getNodeSolidServerCookie...

Response {type: "opaqueredirect", url: "https://inrupt.net/login/password", redirected: false, status: 0, ok: false, …}
body: null
bodyUsed: false
headers: Headers {}
ok: false
redirected: false
status: 0
statusText: ""
type: "opaqueredirect"
url: "https://inrupt.net/login/password"
__proto__: Response

CxRes avatar Dec 03 '20 01:12 CxRes

I've added some error-trapping for the login process - https://github.com/solid/solid-auth-fetcher/pull/16 but since I've not seen anything like what you got above, I don't even know how to test for it. Is this coming from a specialized environment or straight from the command line?

jeff-zucker avatar Dec 03 '20 01:12 jeff-zucker

Yes, as mentioned above this is happening in an nwjs environment. However, I cannot identify anything environment specific that would prevent fetch from doing its thing. But #10 seems to occur in node.

I have special characters in the password which like #10 might be tripping me up. But strangely it worked fine for me in a node environment ( :head-scratching: )

CxRes avatar Dec 03 '20 10:12 CxRes