-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch error when neither auth or username and password LRS properties are set #148
Comments
I've had to deal with a LMS that does not provide any of the auth, username, pw query param. It relies on session cookie already set by the LMS, and the endpoint is on the same domain. I think the Authorization header should just be ommited if no auth params are set. @brianjmiller what do you think? Should I create a PR? |
@jybleau though I don't love the reason, in general the LMS should not do that, and I don't think we'd accept a patch to allow that, ultimately maybe they should accept something in |
@brianjmiller that makes sense. I doubt i will make them change, but I'll ask. Possible options I see. https://github.com/RusticiSoftware/TinCanJS/blob/master/src/LRS.js#L287 Then it will not crash when calling Or B: Thanks |
Currently, if you don't specify either auth or username and password config properties (maybe you specify key and secret by mistake) and then try to make a request (e.g. send a statement) the error you get in node is one that comes from the xhr2 library complaining that your trying ton convert a null property (the auth header value) toString.
It would be 'nice to have' for TinCanJS to catch the error further up the chain with a message that you tried to make a request when the LRS auth is null and to check that either auth or username and password are set.
The text was updated successfully, but these errors were encountered: