Skip to content

Commit

Permalink
test cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanelaf committed Jul 19, 2024
1 parent b37713b commit ae20a70
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/nomalab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ export class Nomalab {
}

async getShow(showUuid: string): Promise<Show> {
const response = await this.#fetch(`shows/${showUuid}`, {});
const headers = new Headers();
const setCookie = `sessionJwt=${this.#apiToken}`;
if (setCookie != null) {
headers.append("Cookie", setCookie);
}
const cookie = mod.getCookies(headers);
const response = await this.#fetch(`shows/${showUuid}`, {
cookieHeader: cookie,
});
if (!response.ok) {
this.#throwError(
`ERROR - Can't find show with id ${showUuid}.`,
Expand Down

0 comments on commit ae20a70

Please sign in to comment.