Skip to content

Commit c0c91e7

Browse files
committed
chore: version
1 parent 709be75 commit c0c91e7

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"axios": "^1.11.0"
1313
},
1414
"name": "scratchattach.ts",
15-
"version": "1.0.5",
15+
"version": "1.0.6",
1616
"description": "Typescript package for accessing https://scratch.mit.edu/",
1717
"author": "faretek1",
1818
"license": "MIT",

src/site/session.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,10 @@ export async function login(username: string, password: string,
188188

189189
const sc = resp.headers['set-cookie'];
190190

191-
if (sc === undefined) {
192-
throw new Error('Did not receive set-cookie');
193-
}
191+
expect(sc).toBeDefined();
192+
193+
const sid = new RegExp('"(.*)"').exec(sc!.toString());
194194

195-
const sid = new RegExp('"(.*)"').exec(sc.toString());
196195
if (sid === null) {
197196
throw new Error('Did not receive SessID. Maybe a wrong username or password? Or possibly too ' +
198197
'many incorrect login attempts means you need to login manually online?');

0 commit comments

Comments
 (0)