1
0
Fork 0
mirror of https://github.com/classchartsapi/classcharts-api-js.git synced 2026-05-14 11:58:13 +00:00

fix: set ky credentials to undefined

Ensures cf workers compat
This commit is contained in:
James Cook 2023-04-16 15:31:18 +01:00
parent 597d3f1960
commit 5826faff19
3 changed files with 3 additions and 0 deletions

View file

@ -69,6 +69,7 @@ export class ClasschartsClient {
Authorization: "Basic " + this.sessionId, Authorization: "Basic " + this.sessionId,
...kyOptions.headers, ...kyOptions.headers,
}, },
credentials: undefined,
} satisfies KyOptions; } satisfies KyOptions;
if (options?.revalidateToken === true && this.lastPing) { if (options?.revalidateToken === true && this.lastPing) {
if (Date.now() - this.lastPing + 5000 > PING_INTERVAL) { if (Date.now() - this.lastPing + 5000 > PING_INTERVAL) {

View file

@ -41,6 +41,7 @@ export class ParentClient extends ClasschartsClient {
method: "POST", method: "POST",
body: formData, body: formData,
headers: headers, headers: headers,
credentials: undefined,
}); });
if (response.status != 302 || !response.headers.get("set-cookie")) if (response.status != 302 || !response.headers.get("set-cookie"))
throw new Error( throw new Error(

View file

@ -37,6 +37,7 @@ export class StudentClient extends ClasschartsClient {
body: formData, body: formData,
redirect: "manual", redirect: "manual",
throwHttpErrors: false, throwHttpErrors: false,
credentials: undefined,
}); });
if (request.status != 302 || !request.headers.get("set-cookie")) { if (request.status != 302 || !request.headers.get("set-cookie")) {
throw new Error( throw new Error(